<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Is this what you intended?<div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><br></div><div>#!/usr/bin/env perl</div><div><br></div><div>my $string = "The good\n\nThe bad\n\nThe Ugly";</div><div><br></div><div>my @str = split /\n\n/, $string;</div><div><br></div><div>print "Second thru last element: " . join(", ",@str[1..$#str]) . "\n";</div></blockquote></div><div><br></div><div><br></div><div>Look at the double quotes on "my $string", don't use a string literal.</div><div><br></div><div>And look at the last line, using a slice of @str.</div><div><br></div><div><br></div><div><br><div><div>On Jul 24, 2013, at 9:42 AM, Richard Reina <<a href="mailto:gatorreina@gmail.com">gatorreina@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Can anyone tell me what I'm doing wrong?<br><br>#!/usr/bin/perl -w<br><br>my $string = 'The good\n\nThe bad\n\nThe Ugly';<br><br>my @str = split /\n\n/, $string;<br><br>print "Second thru last element: " . $str[1..$#str] . "\n";<br><br><br>GIVES ME:<br><br>Use of uninitialized value within @str in range (or flip) at<br>test_split.pl line 7.<br>Argument "" isn't numeric in array element at test_split.pl line 7.<br>Second thru last element: The good\n\nThe bad\n\nThe Ugly<br>_______________________________________________<br>SanFrancisco-pm mailing list<br><a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br>http://mail.pm.org/mailman/listinfo/sanfrancisco-pm<br></blockquote></div><br><div apple-content-edited="true">Francisco Obispo <br>Director of Applications and Services - ISC<br>email: <a href="mailto:fobispo@isc.org">fobispo@isc.org</a><br>Phone: +1 650 423 1374 || INOC-DBA *3557* NOC<br>PGP KeyID = B38DB1BE<br><br><br></div><br></div></body></html>