Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    Posts
    8

    Unanswered: printing array elements in perl

    how do i print array element in perl without going to next line.
    For eg:
    my @process = some array here
    and when i try to do
    print process[2];

    It prints the value but goes to next line....
    can i avoid this...?

  2. #2
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    167
    Code:
    my @process = ...;
    chomp(@process); # removes trailing newline for each element of array
    print $process[2];
    board.perl-community.de - The German Perl-Community

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •