Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
perl basic help
madmax
can somebody explain me :
this below code since today is my 1st day of study perl.
# Import routines from library
use TeamSite::Usertask qw(
cleanup_paths
get_names_from_file
get_mail_cmd
make_branchpathlist
);
Find more posts tagged with
Comments
gzevin
well, during the first day this is not the code you should be studying, frankly.
however, it represents an instruction to perl interpreter to use (load) the module and make available a number of routines (methods) specified.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Migrateduser
This is one of those rare cases in life where the comment is actually helpful. What it's doing is importing some routines from a library.
From the command line, do a
perldoc perlmod
to learn about modules in general, and a
perldoc -f use
to learn about the use function.
Migrateduser
Studying perl by looking at IW scripts = disaster. A better idea would be taking a course on perl - even a learn Perl in 21 days book would be better for you than trying to make sense of existing scripts in an IW context. Do yourself and the DevNet community a favor - sit down with a book or take a class. You won't learn Perl by posting basic questions here.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
I totally agree with smitty... iwperl is NOT standard Perl, but is based on Perl. In other words, if you were to study Perl and become comfortable with it, it's a minimal effort to become familiar with iwperl. There are many, many good books written on the topic (learning Perl) and you can also look at the many examples on the web of Perl syntax, etc.
Perl is fun and powerful, but learning a less-effective way might embitter you to the language.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
Migrateduser
In what way would you say it isn't "standard"? The interpreter is vanilla 5.8.2. The only difference is that Interwoven includes more CPAN modules than the core distribution does, and they include their own modules. One could make a case that the actual code they include often exhibits some bad or at least inconsistent coding practices, but you can code crappy perl with the interpreter downloaded from perl.org or activestate.com just as easily.
nipper
>Studying perl by looking at IW scripts = disaster.
Especially pm's written by someone on this group (who shall rename anonymous).
Migrateduser
I thought that would be implied, but good catch
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
No, of course it's built on 5.8.2, but as far as learning Perl, it would be a mistake if someone were to learn the language by looking at IW's examples because of the additional modules.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
gzevin
yes,
one of the installation scripts had a brllian piece of code. In order to take a substring of first 15 characters, the coder (I even remember the name) did something like:
while (length($mystring > 15) {
chop $yistring;
}
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
jbonifaci
Haha, that is priceless Greg,
.
madmax
for getting help in understanding iwperl which book should i buy "perl" or "perl for cgi".
thanks .
Adam Stoller
If you already understand scripting / programming - get O'Reilly's Programmer Perl to start with.
If you are new to scripting / programming (or don't feel comfortable enough with those skills) - get O'Reilly's Learning Perl to start with.
After that - there are a plethora of Perl books out there, of which I believe that almost all of the O'Reilly ones are worth checking out - plus a few non-O'Reilly ones too.
But I suggest start with the basics (Learning Perl / Programming Perl) first - before you try to get into the more complex aspects of Perl coding.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Hazzie
I can highly recommend the book "Perl for Dummies". It might not have the pedigree of the O'Reilly series in the programming community, but it has been one of the easiest books to read and therefore understand I have seen.
Hazzie
TS 5.5.2 on NT.