Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Molt's scratchpad

by Molt (Chaplain)
on Jun 03, 2004 at 10:30 UTC ( #360043=scratchpad: print w/replies, xml ) Need Help??

sub do_funky_tag_thing { my ($text1, $text2) = @_; # Build the command-line args from the web-service # args. Some funky logic here.. my %args; $args{'-opt1'} = $text1 if defined $text1; if (defined $text1 and defined $text2) { $args{'-opt2'} = process_text($text2); } # Log the command to L4P for audit purposes. my $external_command = 'tag '; for my $opt (keys %args) { $external_command .= $opt.' '.shell_escape($args{$opt)) } get_logger->info( "Running external command: $external_command"; ); # Now run the actual command.. with no reliance on # shell_escape() system('tag',%args); }
Log In?

What's my password?
Create A New User
[afoken]: DBD::CSV has a csv_class attribute. You could subclass Text::CSV_XS to handle BOMs, e.g. through File::BOM.
[ELISHEVA]: Text::CSV_XS already can handle boms - see its detect_bom flag
[ELISHEVA]: but it seems that the DBD::CSV layer on top of it doesn't
[afoken]: Also: All other attributes that start with csv_ and are not described above will be passed to Text::CSV_XS (without the csv_ prefix).
[Discipulus]: what about a good 'ol SOPW?
[erix]: Giro d'Italia won by Dumoulin (peccato Nibali)
[ELISHEVA]: csv_detect_bom doesn't work either
[erix]: (SCNR)
[ELISHEVA]: I may have to resort to SOPW - but was hoping that this would be something simple
[erix]: I'd just remove the BOM, it is pretty simple

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-05-28 20:28 GMT
Find Nodes?
    Voting Booth?