On Wednesday, January 21, 2004 10:53, McMahon, Chris queried:
>
>But this script doesn't do right in Windows:
Modify the code as shown, and it should work:
>use warnings;
>use strict;
>my $dir = "E:\\Documents and Settings\\cmcmahon\\Desktop";
You have to escape the spaces, and for some reas
On Monday, December 15, 2003 03:05, John W. Krahn wrote:
>Here is a little quiz for you beginners out there. split() treats its
>first argument as a regular expression. There are TWO exceptions where
>the first argument does not behave the same as a normal regular
>expression. What are they?
T
Hacksaw wrote:
>
> $str =~ s/--\%\%.*?\%\%--/--\%\%\%\%--/sg;
You don't need all those backslashes. This works as well (and IMHO is
easier to read):
$str =~ s/--%%.*?%%--/----/sg;
Alan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Rob Dixon wrote:
> Scott E Robinson wrote:
>>
>> Randal wrote:
>>>
>>> Scott E Robinson wrote:
>>>
(And, sorry for the top-posting. I haven't figured out how to fix
that!)
>>>
>>> Uh, press the down arrow about a dozen times. How *hard* is that?
>>
>> Lotus Notes adds a header to
Andrew Gaffney wrote:
>
>Steve Gilbert wrote:
>> I know there must be a way to do the following:
>>
>> if (($foobar > 3) || ($foo="t" && $bar = "b")) {print
>> "yup"}
>
>if (($foobar > 3) || ($foo eq "t" && $bar eq "b")) {print "yup"}
>
>Your problem is that a single '=' is assignment, not equalit
Paul Harwood wrote:
>I am trying to parse through the following line:
>
>TUITimer> TUI Dead Air Timer::1828ms::
>
>I want to extract the 1828 value. The regex I have is:
>
>if ( /TUI Dead Air(\d+)/ ) {
>
>I know this is wrong but I have tried every variation
>of \s that I can think of with no su
On Tuesday, October 21, 2003 16:01, Kevin Pfeiffer wrote:
>In article <[EMAIL PROTECTED]>, Steve Grazzini wrote:
>
>> On Tue, Oct 21, 2003 at 01:06:44PM -0700, Jeff Westman wrote:
>>> Steve Grazzini <[EMAIL PROTECTED]> wrote:
>>> > On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote:
>>>
>> Big advice #2. Ebay. I buy all new books and expensive books through
>> trusted sellers for about a 50-60% savings. Make sure you can pay media
>> rate on the shipping. $4.00. I routinely buy books for $15-20 here.
>
>I do the same thing, and would add the following sites:
>
>http://www.ali
On Thursday, September 04, 2003 11:11, Marshall, Stephen wrote:
>
>Got it working this way fror the important line, but theres probably a
slicker way of doing it.
>
>$line =~ s/(\s)+/ /g;
>
This will work, but may leave an extraneous space at the beginning and/or
end of the line.
This text:
"
On Wednesday, August 27, 2003 08:30, James Edward Gray II wrote:
>
>On Wednesday, August 27, 2003, at 05:39 AM, Ramprasad A Padmanabhan
>wrote:
>
>> IMHO this list is not for solving puzzles or doing school homework ,
>> It is for people learning perl who are getting stuck due to pure perl
>> p
Robert J Taylor wrote:
>
>[EMAIL PROTECTED] inquired:
>
> >> This regex looks familiar. I'm going to suggest a big change in a
> >> bit.
> >> Oh, and [\s|\S], which could be [\s\S], is kind of awkward.
>
> > what is less awkward than [\s|\S] for 'match anything?'
>
>.
>
>Yes ->.<-
>
>Dot, period,
On Wednesday, August 13, 2003 10:45, [EMAIL PROTECTED] wrote:
>I've been reading the previous post and was wondering about what qr does in
>this code.
>
>use strict;
> use warnings;
>
> my @array = (
> qr'^to: myprog'mi,
> qr'^from: [EMAIL PROTECTED]'mi
> );
>
> my $str = 'To: myprog wi
On Wednesday, August 13, 2003 11:42, Rob Dixon wrote:
>
>Alan Perry wrote:
>> <[EMAIL PROTECTED]> wrote:
>> > I've been reading the previous post and was wondering about what qr
does
>
>[snip]
>
>> For the second array item, the line translates to:
>> print "found\n" if $str =~ '^from: [EMAIL PRO
Jeff 'japhy' Pinyan wrote:
>
>On Aug 14, Perry, Alan said:
>
>>So, /[\s\S]/ would match a "\n", while /./ would not. The equivalent of
>>/[\s\S]/, using period notation, would be /[.\n]/
>
>Not so much; the . in a character class matches just itse
On Thursday, August 07, 2003 11:28, Dan Muey wrote:
>>>sub dump_functions {
>>>use Class::Inspector;
>>>my $r = ref $_[0];
>>>return [ grep /^$r/, @{
>>>Class::Inspector->methods($r,'full','public')} ] }
>>
>> Yeah. The 'return' keyword can even be left out.
>
>Nice! I'll leave it i
On Tuesday, August 05, 2003 12:13, Trevor Morrison wrote:
>
>Hi,
>
>I am trying to step through each line of a file that contains orders that
>were place through a internet shopping cart. I have this code:
>
> open(ORDER,$order) or die "Error opening \"$order\": $OS_ERROR\n";
>
>print "HI\n";
> wh
Paul D. Kraus wrote:
>
>> need any tips as to start perl programming , so if you could help i would
>really appreciate it . Iam really good with batch file programming , anda
>bit > of C++ so if any help could be shot this way i would make it worth
>your while ;D
>
>http://www.amazon.com/exec/obido
Oops, the second batch of code has a problem... It should read:
print "Name your friends: ";
$friends = ;
chomp($friends);
@names = split(/ +/, );
print "I know $names[1].\n";
Sorry about that...
- Alan
-Original Message-----
From: Perry, Alan [mailto:[EMAIL PROTEC
Unlike others that are suggesting that you forget about user input, I
thought you might want to see how it can work on Windows. I know that it
would bug me as to how to do this if I were in your position...
print "Name your friends: ";
@names = split(/[ \n]+/, );
print "I know $names[1].\n";
The
Rob Dixon wrote:
>
>Michael Weber wrote:
>> I know this is a perl list, but just because you have a hammer in your
>> hand doesn't make everything a nail, right?
>>
>> How about
>>
>> sed '132,134d' datafile > newfile
>
>I also have a solution involving a hydraulic jack and a pint of
>whipped crea
See below.
Beau E. Cox wrote:
> Hi -
>
>> From: R. Joseph Newton [mailto:[EMAIL PROTECTED]]
>> Subject: Re: Removing duplicates from an array
>>
>> Troy May wrote:
>>
>>> Hello,
>>>
>>> What's the best and cleanest way to remove duplicates from an array? I
>>> have an array that reads entries
Tony Esposito wrote:
> I am using ActiveState Perl 5.6.1. That does not seem too old to me.
> Is there an ftp site where I can download Tk.pm?
> Then I will install Tk using the Perl Package Mgr.
There is actually no need for that, as long as you have Internet access. If
you type (note the "ppm3
[EMAIL PROTECTED] wrote:
> Hi all,
>
> i have head that switch is introduced from perl 5.8. what are all the
> other new additions to the perl???
For a complete list of changes, go to:
http://dev.perl.org/perl5/news/2002/07/18/580ann/perldelta.html
Alan
--
To unsubscribe, e-mail: [EMAIL PROTE
Perry, Alan wrote:
> And, top-posters can configure it so that they can still top-post,
> but the
>> 's will still get fixed!
Well, I guess it's not perfect... :-)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Bob Showalter wrote:
> Rob Dixon wrote:
>> I personally choose to top-post so that anybody reading through a
>> thread won't have to page to the end of each post to get to new
>> content.
>
> Since all the top-posters are weighing in, I better add my vote
> against it. Responses should be in-line
A better (IMHO) implementation of VI is at http://www.vim.org. The Windows
version can be downloaded at ftp://ftp.vim.org/pub/vim/pc/gvim61.exe.
Enjoy!
-Original Message-
From: Dylan Boudreau [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 10:19
To: [EMAIL PROTECTED]
Subject
Not sure if this will help, but something like this would work...
foreach ( `ls -d1 $source/06/*` ) { # each line of output goes into $_
@group = split(m|/|, $_); # split out filename parts
$pcgname = pop(@group); # gets filename
$bu = pop(@group); #
Yep, just leave off the "$element" from the statement you wrote. Then you
can use $_ for the current element.
Example:
@array = ("first", "second", "third", "fourth");
foreach (@array) {
print "$_\n";
}
would print
first
second
third
fourth
- Alan
-Original Message-
From: Sturdevan
>From perlfaq8,
How do I ask the user for a password?
(This question has nothing to do with the web. See a different FAQ for
that.)
There's an example of this in crypt in the perlfunc manpage. First, you put
the terminal into ``no echo'' mode, then just read the password normally.
You may do thi
I think the second example should be:
foreach(sort {$hash{$a} cmp $hash{$b}} keys %hash){
do something...
}
Notice the %hash (and not $hash) at the end.
-Original Message-
From: Timothy Johnson [mailto:tjohnson@;sandisk.com]
Sent: Wednesday, November 06, 2002 17:07
To: 'Kurtis'; [EMAI
30 matches
Mail list logo