Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: problems with global $1

by brian_d_foy (Abbot)
on Oct 22, 2007 at 20:12 UTC ( [id://646566]=note: print w/replies, xml ) Need Help??


in reply to problems with global $1

Every line that has $1 on it has an uninitialized value, and it's not $1. This isn't your real program though; this doesn't get past use strict since you haven't declared the variables, and you've got a couple of syntax errors. Perhaps your test program was supposed to be:

use strict; use warnings; $_ = "ArraySize 4285"; my $luns_per_array = 10; my $logical_size; # useless variable? if ( /^ArraySize (.+)/ ) { print "\nArray: " . $1 . " yields a LUN of " . int($1/$luns_per_ar +ray) . "GB\n" ; $logical_size = int($1/2); if ( ( $logical_size * $luns_per_array ) == $1 ) { {$logical_size--;} } }
--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://646566]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found