Technical Help & Discussion > Website Design & Programming

Very small perl question

<< < (2/2)

DualBoy:
I have posted some old lessons I had back in University on Unix and CGI/Perl also bash and some stuff on grep and much more:

http://www.travisjmac.com/unix/

Chapters 7 thru 11 will give you a good understanding of Perl and its not a very long read either. You can probably skim thru each chapter in about 20-30 minutes and feel free to write some basic code to test strings, arrays and much more.

DualBoy:
In many languages it is rather cumbersome to include in a quoted string the same quote mark being used to delimit the string. In Perl, as in C, you can use the backslash quote mechanism (in both single and double-quoted strings):

 $dstrng = &quot;this is a &quot;-quoted string
&quot;;
 $sstrng = 'this is a '-quoted string';     # can't do
 though
 
but this gets tiresome if there's more than one embeded quote. Perl also provides a completely different syntax for creating strings, which is exactly equivalent to the more usual forms:
 $dstrng = qq{this is a &quot;-quoted string
};  # qq is same as &quot;
 $sstrng = q{this is a '-quoted string};     # q is same as '
 $bstrng = qx{grep '^dualboy:' /etc/passwd};   # qx is same as `

bat69:
Thanks DB ... there is an awful lot of very good stuff there to read, infact just what I've been looking for so I can start to learn more about coding  8)

DualBoy:
No problem. I Have lots of stuff in PDF file format on Linux and PHP and many other langs. Also some old computer contests and such taht are fun to do once your more into programming.

bat69:
Sounds great ... need to get off the ground first  :- tho, but its something I aim to do. That is one of the reasons I want to install Linux, so I have more incentive to dabble ... used to do lots of programming at school/college, but that was a long time ago, and haven't used it since.

Navigation

[0] Message Index

[*] Previous page

Go to full version