[Perl-unix-users] auto-detecting file encoding

2006-06-18 Thread DZ-Jay
Hello: I need to process the text of thousands of files automatically, with simple regexp substitutions. The problem I have is that, although all files are plaintext, they have been written with a variety of programs in Windows, so they employ diverse encodings. For example, some are in '

Re: [Perl-unix-users] regular expression question

2006-04-27 Thread DZ-Jay
On Apr 26, 2006, at 22:50, $Bill Luebkert wrote: or simpler if you just are interested in ucmvob being present: return $Output =~ /ucmvob/ ? 1 : 0; Or to make sure that it is not a substring within another "word": return $Output =~ /\bucmvo\b/ ? 1 : 0; The "\b" will match at

[Perl-unix-users] Re: Strange behaviour in Perl

2006-01-25 Thread DZ-Jay
Arijit Das wrote: > I am just wondering why is this giving a strange result. Any clues...? > > bash-2.01$ echo 4.56 | perl -p -e 'my $var1 = ; $var2 = $var1 * 100; print $var2;' > 04.56 > bash-2.01$ > > I am expecting 456 in the ouput instead of 4.56 > > Am I missing anything...? > Remov

Re: [Perl-unix-users] Strange behaviour in Perl

2006-01-25 Thread DZ-Jay
Arijit Das wrote: I am just wondering why is this giving a strange result. Any clues...? This is from the Perl In A Nutshell book: -- -p: Causes Perl to assume the following loop around your script, which makes it iterate over filename arguments: LINE: while (<>) { .