Search Results

Search: Posts Made By: natong
1,555
Posted By natong
[Perl] Does m/\x0A/ same as m/\x{0A}/ ?
Perl allow hex character with just one digit.
Such as \x0 \x9 \xA.

How to force to use 2 digits in m// and s///.
Such as \x00 \x09 \x0A.

---------- Post updated at 05:20 PM ----------...
4,288
Posted By natong
$_ =~ s/\$(\w+)/${$1}/g; #I don't know why...
$_ =~ s/\$(\w+)/${$1}/g; #I don't know why didn't work
$_ =~ s/(\$\w+)/$1/eeg; #Work!
These can replace any variables. Thanks!
4,288
Posted By natong
Good idea. Use search and replace. No other...
Good idea. Use search and replace. No other solution?


$name = "David";

open(HEADER,'hello.htm');
while(<HEADER>) { $_ =~ s/\$name/$name/g; $html .= $_; }
close(HEADER);

print "$html";
4,288
Posted By natong
[Solved] Perl: How to read text from file and process $variable in that data too.
In the hello.htm have the sentenses:
Hello $name
How are you?
The perl script:
$name = "David";

open(HEADER,"hello.htm");
while(<HEADER>) { $html .= $_; }
close(HEADER);

print "$html";I...
1,091
Posted By natong
hi there, Sorry. it's my fault.. It looklike...
hi there,

Sorry. it's my fault.. It looklike my script process the windows text file .dat with CR/LF.

when upload to unix it doesn't strip CR. I have to upload .dat in ASCII mode and my script...
1,091
Posted By natong
my v5.10.0 built for MSWin32-x86-multi-thread ...
my v5.10.0 built for MSWin32-x86-multi-thread can print those variable. But v5.8.8 built for i686-linux can't print.

It did ignore $category[$i] and print only

.dat or something
1,091
Posted By natong
[perl] Can't print "$category[$i].dat or something\n";
Hi, I can't print array variable in the sentense.

print "$category[$i].dat or something\n";
Some perl version can use, some can't.
How to solve it.

Thanks for advance.
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 12:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy