Re: What is the meaning of this regexes .*? (was Re: regex)

2002-01-05 Thread Bkwyrm
Le Sat, Jan 05, 2002 at 08:51:19AM +0800, Leon a dit le suivant: } } > If so, I suggest something like: } > $text =~ s/.*?//gs; } } * means zero or more instances; } ? means zero or one instances; } + means one or more instances; } } so what is the meaning of .*? .. matches any type of input

[Re: perl script to remove control M's]

2001-12-05 Thread Bkwyrm
#!/usr/bin/perl -i while (<>) { /\n/g;; print $_; } -- Namaste, Kristin "The universe seems neither benign nor hostile, merely indifferent." - Carl Sagan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Elegant way to find/remove line from text file - REDUX

2001-11-29 Thread Bkwyrm
> perl -ni -e 'next unless /foo/' myfile.txt Actually, finally got this to work this way to remove all lines but those containing foo: perl -ni -e 'next unless /foo/; print;' myfile.txt and this way for all those not containing foo: perl -ni -e 'next if /foo/; print;' myfile.txt -- Na

[Bob_Showalter@taylorwhite.com: RE: Elegant way to find/remove line from text file]

2001-11-29 Thread Bkwyrm
Tested these in order to learn how they work, and the first one simply deleted the entire contents my test file which was peppered with foo on multiple (but not all) lines - Forwarded message from Bob Showalter <[EMAIL PROTECTED]> - Second, the canonical one-liner to delete lines f

Re: PERL IS NOT A HIGH LEVEL LANGUAGE

2001-08-20 Thread Bkwyrm
*- chucking in my extreme newbie's 2-cents'-worth -* Has anyone out there noticed that, when shopping at almost any of the huge book conglomerates, Perl is almost never shelved with the rest of the programming languages, but instead with Javascript and HTML in the "Web" section? -- Namaste, Kr

Re: Getting options from the command line

2001-05-17 Thread Bkwyrm
I don't know if this will help at all, but I just found out, myself, about the -s option. If you run your script with: #!/usr/bin/perl -s and remember, to keep strict happy, to: use vars qw($all_the $variables $you_need $from_stdin); You can run your script like this: bash-2.03$ script.pl -varia

Re: Dividing up text files, HELP!!

2001-04-17 Thread Bkwyrm
I have used join in order to make one big line of a document for searches such as the one you suggest. Also, in another script I did this: open(FILE,"$_"); my $txt = ""; $searchfile = $_; while () {$txt .= $_;} close(FILE); ## Search $txt for $string; if it is found, write the name