Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: SCS2CSS

by chromatic (Archbishop)
on Nov 20, 2001 at 09:31 UTC ( #126474=note: print w/ replies, xml ) Need Help??


in reply to SCS2CSS

Care for a couple small suggestions?

my $argc = @ARGV; if($argc != 1) { print "Usage: \$ $0 <scsfile>\n"; exit; } my $scs = $ARGV[0];
This could be more succinct as:

my $scs = shift or die "Usage: $0 <scsfile>\n";

Don't forget to check the success of your open calls.

You might want to escape the periods and anchor the ends of your regular expression. File::Basename might also come in handy, but may be severe overkill:

(my $css = $scs) =~ s/\.scs\z/.css/;

A heredoc would make the print statements somewhat more manageable. Roll on Perl 6 and intendable heredocs!


Comment on Re: SCS2CSS
Select or Download Code
Replies are listed 'Best First'.
Re{2}: SCS2CSS
by staeryatz (Monk) on Nov 21, 2001 at 15:41 UTC
    Thanks for the tips. :)

    I never would have thought of putting the argument vector processing all in one line like that. I kinda just did it the 'C' way. Kudos to you.

    Ah, the heredoc operator...I don't know why I haven't thought of that one myself (I use it all the time for cgi). But the strangest thing of all, is why did I put my print staements in parenthesis?

    The mysteries of programming on \0 caffeine. This could be an X-File...

    Update: Okay, I finally changed it and tested it. It looks alot better now, thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://126474]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2015-07-07 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls