well first 4 lines takes arguments that are passed to function and put them in variables that are scalars (they begin with $).
"shift" means: take from
@_ array first element ..
$_[0] and than move one place to the left (
$_[1] becomes
$_[0], etc)
if scalar
$text is empty than it displays the message.
if you dont know OOP in Perl you should read
perltoot, but in short:
the name of the class is passed in first argument of function. Then the new class of that type is created. Then new atribute is added to the new class which references the data in
$text variable
that is what
$self->{_text} = \$text; means.
You could gave us the content of SWISS.pm module which have definitions of classes, I think.
type:
perl -e "print @INC"
that will show you where to search for that SWISS.pm
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.