Helpful Information
 
 
Category: Perl FAQs and Stickies
New users ::: HOW TO POST A QUESTION - READ THIS FIRST

Please check this read in PHP forum

http://forums.devshed.com/showthread.php?threadid=24097&forumid=5

It is not particular to PHP and applies in general.

Read this before posting a thread if you are new.

JD

The above thread instructs you to put [php] tags around your code. DO NOT DO THIS FOR PERL CODE! Just use the generic [ code ] tags. It won't be colored, but it will be correct. The php tags tend to destroy Perl code (and likely other languages), especially around escape characters.

Ax brought this up and I figured it was worth a formal mention.

Also, put the tags around indented code, ie, what you should originally be working with. Example, if your post looks like this:
while( <FILE> )
{
if(/^pattern$/)
{
print;
last;
}
}and someone asks you to put [ code ] tags around it, don't copy what you posted and put tags around it, copy from the original source with all the indentation, and make it look like this:
while( <FILE> )
{
if(/^pattern$/)
{
print;
last;
}
}It'll make our lives easier and more willing to help. If you're feeling really industrious, check out Perl::Tidy (http://search.cpan.org/author/SHANCOCK/Perl-Tidy-20030726/lib/Perl/Tidy.pm) or its command-line version perltidy (http://search.cpan.org/author/SHANCOCK/Perl-Tidy-20030726/bin/perltidy).

A new BBCode tag has been added to Dev Shed, in order to make it easier to link to modules on CPAN (without having to look up the URL yourself!). More specifically, it links to the appropriate search on http://search.cpan.org.

For example, to create a link to the HTML::Template module, I'd type:
Comment Text

This would be converted into this:
Comment Text

I've also requested a [perldoc] tag to be added to link to a search for the Perl documentation - watch this thread (http://forums.devshed.com/t254840/s.html) for updates on that.

I'm replying rather than editing my post above so that people will notice that something has changed.

The [perldoc] tag has now been added too - it will link to a search for whatever you specify in the tag, for example:

Regular Expressions Tutorial
. . . becomes . . .
Regular Expressions Tutorial

Further to icrf's post above about using [code] tags, Perl syntax highlighting is now available (http://forums.devshed.com/showthread.php?t=279108) by using ... code in here ... in posts. Here's a demonstration:

while( <FILE> )
{
if(/^pattern$/)
{
print grep +( substr( $_, 0, 1 ) eq 'a' ), @array;
last;
}
}
Note that this will also add links from all functions to their documentation for folks who need more of an explanation.










privacy (GDPR)