Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Name "main::a" used only once: possible typo

by mithaldu (Monk)
on Mar 11, 2013 at 13:23 UTC ( #1022794=note: print w/replies, xml ) Need Help??


in reply to Name "main::a" used only once: possible typo

I am confused that nobody suggested:

print reduce { $_[0] * $_[1] } 1..6;

Replies are listed 'Best First'.
Re^2: Name "main::a" used only once: possible typo
by toolic (Bishop) on Mar 11, 2013 at 13:38 UTC
    Perhaps because it produces the incorrect result and 8 more warning messages:
    #!/usr/bin/env perl use warnings; use strict; use List::Util qw/reduce/; print reduce { $_[0] * $_[1] } 1..6; __END__ Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. Use of uninitialized value in multiplication (*) at x.pl line 7. 0
Re^2: Name "main::a" used only once: possible typo
by LanX (Chancellor) on Mar 11, 2013 at 13:40 UTC
    cause it doesn't work?

    use List::Util qw/reduce/; print reduce { $_[0] * $_[1] } 1..6; __END__ Use of uninitialized value in multiplication (*) at /home/lanx/B/PL/PM +/ScopeListUtils.pl line 23. ...

    Cheers Rolf

      Well damn. I was sure i had used that on List::Util stuff to get around $a/b warnings. Guess i misremembered.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1022794]
help
Chatterbox?
[james28909]: i am not sure how to ask google this either
[james28909]: i am getting the current time on my machine with scalar localtime;
[james28909]: i am scraping a website and retrieving a date stamp of an article.
[james28909]: well time/data stamp of the article
[stevieb]: james28909: what's the problem/question?
[james28909]: it is not an absolute date like "27" or "31". sometimes it is like wednesday or friday
[james28909]: and i need to format those special instances into an absolute date instead of "yesterday"
[stevieb]: ask a question on SoPW, and include at least a half-dozen examples of the input, and at least one example of expected output
[davido]: Exactly: SoPW. This isn't going to be solved easily in the CB.
[james28909]: in need "yesterday" and so on, to be absolute like "1" or "31"

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-04-29 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.