Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^2: Data::Table - empty values - avoid warnings

by GertMT (Friar)
on Oct 24, 2007 at 20:23 UTC ( #647003=note: print w/replies, xml ) Need Help??

in reply to Re: Data::Table - empty values - avoid warnings
in thread Data::Table - empty values - avoid warnings

thanks for your reply. I'm a bit puzzled with the regex.
((defined($_->[0]) && $_->[0] =~ m/^\d+$/) ? $_->[0] : 0)

Am I correct if I assume that here $_ is defined as 'one single digit or maybe a few digits (d+, no spaces and stuff like that in between the digits) and then if this is not the case it should be a 0 (zero)? Never used this ternary operator and just want to make sure that's what it is.

Replies are listed 'Best First'.
Re^3: Data::Table - empty values - avoid warnings
by Anonymous Monk on Oct 25, 2007 at 05:31 UTC
    Am I correct if I assume that here $_ is defined as 'one single digit or maybe a few digits ...

    No, $_ is array reference not a scalar. $_ is not being tested for simple number-ness, but the deferenced value, $_->[0], is. Other than that, you are correct in your reading about which value is eventually going to be added.

    - parv

      Oh, but a array reference is a scalar, if only a special type of it.

      No, $_ is array reference not a scalar.

      That was rather thoughtless of me. First sentence should have been: "No, $_ is array reference (not a simple value)."


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://647003]
[Corion]: choroba: I'm still using spod5 as my pod-to-ooxml- converter didn't really get off the ground so far
[choroba]: Slidy is basically HTML, so I'm not sure I really fly high :)
choroba should make his presentation scaffolding public
[Corion]: choroba: spod5 converts pod to S5 HTML, so it's also still basic. I find the lack of animations (in the sense of "highlight this", "highlight that" in code) somewhat tedious as I do it with rendered PNGs
[Corion]: I haven't found a good way to include/use the source SVGs I use for creating the PNGs directly as animations
[ambrus]: Presentations come in many different shapes, and so slides do as well.
[Corion]: Doing that in Powerpoint or Ooxml would be nice(r) but I'm much quicker doing the outline of a presentation and the code as Pod
[Corion]: Hurrr - on a machine that is behaving weirdly, I have two processes CROND running. I guess that is the source of unattended jobs sometimes not finding their files anymore...
[ambrus]: Most of the time if I make slides, they're just a formatted document with a medium level of formality (between a well written article and an informal draft), with usually the page breaks chosen carefully and possibly some content repeated between pages.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-09-26 10:04 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (293 votes). Check out past polls.