Here is the correct version:
#!/usr/bin/perl
$csproj_text = C:\\build.txt;
$csproj_text =~ s/\\//g;
print $csproj_text\n;
Notice that in order to put a literal backslash into a perl string,
you should escape it. In your original program, you have put a \b, a
bell character into the string.
I am new to perl and have a doubt. I have a script that needs to run a
command. The command that is being run requires input from the user to
proceed. Instead of prompting the user how can I code the utility to not
prompt the user but take the input from a variable that has the value that
is to
Is there a way to debug concurrent perl programs, i.e. programs that
use fork()? E.g. I would like to watch the main process. At a naive
try I got strange error messages.
- Gergely
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi there,
I'm to use pod2html but I don't have administrator rights so would
like to install it in my home directory. Is that possible?
- G
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Hi,
this is a working code snippet:
opendir (DIR, $dir) || die Open failed: $!\n;
$\ = \n;
while ($_ = readdir(DIR)) { print; };
But when I try to use
while (readdir(DIR)) ...
my script writes only empty lines. It seems that the proper number of
empty lines are written. Does the prepended $_
Hi there,
why my regex does not work as I expect? I would like to match the
lines consisting of only letters, at least one of them:
#!/usr/bin/perl
while (STDIN)
{
if (/^[:alpha:]+$/)
{
print;
}
}
It seems that my perl (5.8.something) does not understand
Hi there,
why is the script
#!/usr/bin/perl
foreach $key (sort keys %ENV) {
print $key=$ENV{$key}\n;
}
returns much less variable than
$ set
using bash?
- Gergely
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi there,
do you have a clue why is this not working? The interpreter complains
about a syntax error in line 7 near $myhash.
#!/usr/bin/perl
%myhash = { alma = apple, korte = pear };
foreach $ky (keys (%myhash))
{
print $ky, : , $myhash($ky), \n;
}
--
To unsubscribe, e-mail: [EMAIL
Thank you all for your answers.
- Gergely
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response