Sep 21, 2007 #1 cdlvj MIS Nov 18, 2003 676 0 0 US This is from a class object and is supposed to return a list. It is returning an array with what looks like a TRUE/FALSE in the array. $dati = "file1\nfile2\nfile3\n"; Code: return $dati ? split( /\n/, $dati ) : ();
This is from a class object and is supposed to return a list. It is returning an array with what looks like a TRUE/FALSE in the array. $dati = "file1\nfile2\nfile3\n"; Code: return $dati ? split( /\n/, $dati ) : ();
Sep 21, 2007 #2 travs69 MIS Dec 21, 2006 1,431 0 0 US How are you calling this in your script? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions; Upvote 0 Downvote
How are you calling this in your script? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
Sep 21, 2007 Thread starter #3 cdlvj MIS Nov 18, 2003 676 0 0 US Code: my @list; my $clsa; @list = $clsa->list(); @list = ( 1 ); should be @list = ( "file1", "file2", "file3"); Upvote 0 Downvote
Code: my @list; my $clsa; @list = $clsa->list(); @list = ( 1 ); should be @list = ( "file1", "file2", "file3");
Sep 21, 2007 #4 KevinADC Technical User Jan 21, 2005 5,070 0 0 US return $dati ? split( /\n/, $dati ) : (); the above is returning a list in scalar context. Should be: return @dati ? split( /\n/, $dati ) : (); ------------------------------------------ - Kevin, perl coder unexceptional! Upvote 0 Downvote
return $dati ? split( /\n/, $dati ) : (); the above is returning a list in scalar context. Should be: return @dati ? split( /\n/, $dati ) : (); ------------------------------------------ - Kevin, perl coder unexceptional!