athanasia has asked for the wisdom of the Perl Monks concerning the following question:
I found that if <variable_value> is a string starting with a hash (#), then $value remains undefined. If I enclose the string in "", then $value is properly defined. However, I do not have (easy) access to the c program that calls myscript.pl.#!/usr/bin/perl use warnings; use strict; my ($command, $pathname, $value); $command = shift @ARGV; $pathname = shift @ARGV; if (defined $pathname and $pathname ne '') { if (($command eq "set") or ($command eq "add") or ($command eq +"del")) { $value = shift @ARGV; } else ..... } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Capture string that starts with #
by johngg (Canon) on Dec 04, 2008 at 10:00 UTC | |
|
Re: Capture string that starts with #
by Anonymous Monk on Dec 04, 2008 at 09:32 UTC | |
|
Re: Capture string that starts with #
by lakshmananindia (Chaplain) on Dec 04, 2008 at 11:11 UTC | |
|
Re: Capture string that starts with #
by viji_india (Initiate) on Dec 04, 2008 at 11:12 UTC |