#1
  1. phpkid ~~~~~~ :o)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Nov 2000
    Location
    NJ, USA
    Posts
    2,534
    Rep Power
    17

    Lightbulb New users ::: HOW TO POST A QUESTION - READ THIS FIRST


    Please check this read in PHP forum

    [NEW USERS] - How to post a question.

    It is not particular to PHP and applies in general.

    Read this before posting a thread if you are new.

    JD
    _____________________________
    d.k.jariwala (JD)
    ~ simple thought, simple act ~
    I blog @ http://jdk.phpkid.org
  2. #2
  3. Perl Monkey
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    May 2003
    Location
    the far end of town where the Grickle-grass grows
    Posts
    1,860
    Rep Power
    109

    Use [code] tags, NOT [php] tags!!


    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:
    Code:
    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 or its command-line version perltidy.
    Andrew - Perl (and VB.NET) Monkey

    Never underestimate the bandwidth of a hatchback full of tapes.
  4. #3
  5. kill 9, $$;
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2001
    Location
    Shanghai, An tSín
    Posts
    6,898
    Rep Power
    3887
    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:
    [cpan=HTML::Template]Comment Text[/cpan]

    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 for updates on that.

    Comments on this post

    • icrf agrees : awesome, I think I should spend more time here
  6. #4
  7. kill 9, $$;
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2001
    Location
    Shanghai, An tSín
    Posts
    6,898
    Rep Power
    3887
    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:

    [perldoc=perlretut]Regular Expressions Tutorial[/perldoc]
    . . . becomes . . .
    Regular Expressions Tutorial
  8. #5
  9. kill 9, $$;
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2001
    Location
    Shanghai, An tSín
    Posts
    6,898
    Rep Power
    3887
    Further to icrf's post above about using [code] tags, Perl syntax highlighting is now available by using [highlight=perl] ... code in here ... [/highlight] in posts. Here's a demonstration:

    perl Code:
    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.

IMN logo majestic logo threadwatch logo seochat tools logo