in reply to variable declaration shortcut question

Not quite, what you can do is ... (my $maid = $fields[0]) =~ /(^\d*)/; my ($maid) = $fields[0]) =~ /(^\d*)/; - as per Recipe 6.1 in the Cookbook.

Update:

Thanx to ikegami twice over - wholly misplaced paren

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^2: variable declaration shortcut question
by ikegami (Patriarch) on Feb 03, 2009 at 15:54 UTC
    $ perl -e'my ($maid = $fields[0]) =~ /(^\d*)/;' Can't declare scalar assignment in "my" at -e line 1, near ") =~" Execution of -e aborted due to compilation errors.
Re^2: variable declaration shortcut question
by ikegami (Patriarch) on Feb 03, 2009 at 16:00 UTC
    Now both parens are misplaced. Code posted earlier by the OP shows that he wants the captured digits in $maid.
Re^2: variable declaration shortcut question
by lomSpace (Scribe) on Feb 03, 2009 at 17:20 UTC
    I am reading it right now!
    Thanks!