G
Gerald Jones
Two perl programs:
$ echo dajsjd hdajshd | perl -ne '($foo, $bar) = split; print "1. $foo 2. $bar\n"'
1. dajsjd 2. hdajshd
$ echo dajsjd hdajshd | perl -ne '($foo, $bar) = split @_; print "1. $foo 2. $bar\n"'
1. dajsjd hdajshd
2.
$
Given no args, doesn't split operate on @_? Also, isn't the default string to
split on a whitespace? So why the above differences?
$ echo dajsjd hdajshd | perl -ne '($foo, $bar) = split; print "1. $foo 2. $bar\n"'
1. dajsjd 2. hdajshd
$ echo dajsjd hdajshd | perl -ne '($foo, $bar) = split @_; print "1. $foo 2. $bar\n"'
1. dajsjd hdajshd
2.
$
Given no args, doesn't split operate on @_? Also, isn't the default string to
split on a whitespace? So why the above differences?