`perl process_file $f`;
}
Personally, I would prefer to have the other process embedded in the
main script rather than invoking a separate process using back-tics
(or any of the other, similar methods).
If you also need it as a stand-alone process, how about making a
module you can
double quotes
> my $str = 'abc123xyz';
> $str =~ s/$p1/$p2/ee; #Note double e
> print $str, "\n";
Yes, that works too! I like not using eval (it makes me feel "dirty" :) ).
Did you "quote-out" the double-quotes just to make them more obvious? Beca
On 7/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> hi pDale --
>
> In a message dated 7/15/2006 12:35:22 A.M. Eastern Standard Time,
> [EMAIL PROTECTED] writes:
>
> > I'm having a hard time "asking the question" to Google...
> >
> &
/$p2/;
print "$str\n";
# This prints out "$2 $1", $1 and $2 weren't interpreted :(
__CODE_ENDS__
So, what really simple thing am I doing wrong?
TIA
--
pDale Campbell
Desperation = A Rope Ends It
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
On 7/11/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Gurus,
>
> I'm in something of a quandary here. I'm creating a Perl script for UNIX
> that has to do stuff like mkdir, chmod, chown, chgrp, etc. What's the
> "best" way of getting these commands executed? A system() call? an eval {}
> bl
a
> line of code.
>
> And believe it or not, reading up on something probably takes less time
> than waiting on a mailing list response.
I would suggest you look into the GUI debugger module PTKDB. I love
CLI as much as the next curmudgeon, but there's something to
On 7/7/06, $Bill Luebkert <[EMAIL PROTECTED]> wrote:
> pDale wrote:
>
> > On 7/7/06, $Bill Luebkert <[EMAIL PROTECTED]> wrote:
>
> >>It would probably be more appropriate (if you're going to have malformed
> >>paths like the above to go more like:
On 7/7/06, $Bill Luebkert <[EMAIL PROTECTED]> wrote:
> pDale wrote:
>
> > On 7/7/06, Cai, Lucy (L.) <[EMAIL PROTECTED]> wrote:
> >
> >>If my file path is like
> >>
> >>My $file = "c:\test/test.txt";
> >>
> >>How c
On 7/7/06, Cai, Lucy (L.) <[EMAIL PROTECTED]> wrote:
>
> If my file path is like
>
> My $file = "c:\test/test.txt";
>
> How can I switch "/" to "\"?
$file =~ s#/#\\#g;
Test case:
perl -e "\$f = qq(C:test/test.txt); \$f =~ s#/#
rict;
use warnings;
The long involves Perl's processing of barewords, why it allows it at
all (for backward compatibility, but dangerous), and how the
language's syntax is defined (e.g., subroutine names can't begin with
a digit).
HTH
--
pDale Campbell
Desperation = A Rope Ends It
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
oy $text;
$text = undef;
I see a package that should make things cleaner, Filter::Handle, but I
couldn't get it to work. It kept crashing Perl with a "deep recursion"
error. I couldn't even get the given example of STDOUT redirection to
a scalar to work. -- Must be something w
for a given
window--seems like that would give you the leverage you would need.
--
pDale Campbell
"Darkness makes me stumble
for a key
to a door
that's wide open."
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
On 5/16/06, Curtis Leach <[EMAIL PROTECTED]> wrote:
Nice example program below, but it does have a bug in it. Here is the
fix.
$str1 =~ s/]*>//gi;
That is not valid HTML. But then, neither was JD's.
--
pDale Campbell
"The a
t;/Image Removed/gi;
--
pDale Campbell
"We were working secretly
for the military." - Experiment IV, Kate Bush
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
On 3/28/06, Bowie Bailey <[EMAIL PROTECTED]> wrote:
> Mario R. Sanchez, Ph.D. wrote:
> > hi pDale
> >
> > this is the entire code ...
> >
> > while(my $row_href = $sth->fetchrow_hashref)
> >{
> > print "$ro
rint "$key = ".$row_href->{$key}."\n";> }
tried it - no output whatsoever
ideas?
Could you post the code you tried?
Also, 'perldoc -f keys' might tell you something.
--
pDale Campbell
"Then there's t
it seems to me
a single message back to them, "Get out of here with your
virus-infested crap!" would be more appropriate than sending out
messages to EVERYONE ELSE on the list saying "Here's some
virus-infested crap we WOULD have sent you if our detectors weren't
triggered
{$server}->{osversion})\n";
# create a reference to one server hash entry for simplified access:
my $srvr = $data->{server}->{$server};
print "Server $server (OS=$srvr->{osname}, Ver=$srvr->{osversion})\n";
foreach my $addr (@{$srvr-
On 12/14/05, Mittal, Manish <[EMAIL PROTECTED]> wrote:
>
> Is there a way in Perl to invoke a set of Database related perl
> scripts at certain times of day regularly?
Unix/Linux has "cron". Windows has "Task Scheduleder".
--
pDale Campbell
&qu
On 11/21/05, Mitch <[EMAIL PROTECTED]> wrote:
> Anybody ever heard of a language called Algol ?
Oh, yeah. And to think people call *Perl* line-noise! (Just came up
recently on a non-prog list.)
--
pDale Campbell
"All the birds are laughing!
C'mon
On 11/21/05, pDale <[EMAIL PROTECTED]> wrote:
> On 11/21/05, Mitch <[EMAIL PROTECTED]> wrote:
> > Anybody ever heard of a language called Algol ?
>
> Oh, yeah. And to think people call *Perl* line-noise! (Just came up
> recently on a non-prog list.)
Oh, I *am* getti
On 11/4/05, KEITA Alhassane Abdel <[EMAIL PROTECTED]> wrote:
> hello.
>
> I've tryed to use some variables declared into my package "test.pm" in my
> script "test.pl". I work under "Windows XP".
>
> "test.pl"
> ---
> use strict ;
> use lib('E:
t;ABC", "DEF", 3, undef, "27", undef, 27 );
print "Record = [" . join( "|", map { defined($_) ? $_ : "" } @ary) . "]\n";
Maybe you'd like to post a piece of sample code with programm
mes and saved me a lot of time
so that I could move on with my project.
Please, let's remember what Winston Churchill said: "When you have to killfile a man, it costs nothing to be polite."
--
pDale
"Two wrongs don't make a ri
On 10/4/05, joe <[EMAIL PROTECTED]> wrote:
In the end, it is all [top vs. bottom-posting] personal choice.
Actually, no. http://aspn.activestate.com/ASPN/Mail/help#4
It is a stupid thing to argue over.
Actually, yes. (see above)
--
pDale Campbell
For S/N, when S=0, N is irre
xt automatically when you
reply to him or forward it. The same cannot be said of quoted
text that follows a top-post. And his sig is within common-law
limits. :)
--
pDale
"...is there no escape
from the words
that plague us so?" - Sarah McLachlan
een
anyway.
But how will others know what you are responding to in particular?
I've also noticed that top-posting and leaving totally-worthless quoted
text below go hand-in-hand. If you don't expect others to need to
read what's below your words, why include it? Don't answ
rv.ActiveState.com> Subject: RE: Top posting
>> For what it's worth, e-mail programs like MS Outlook make it difficultto> *not* top-post. [...]
Your software seems to handle it okay.
One more reason for Mr. Gates to rest on the end of the devil's pitchfork.
--
pDale Campbell
ere. Those desiring
aid would be well-advised to make their posts easy to read for those
most likely to provide a useful answers.
--
pDale Campbell
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
FO, ">foo.out");
binmode FO;
print FO $hex;
close FO;
--
pDale Campbell
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
@lines=; close (FileIn);# --- open outfile in binary modeopen (FileOut, ">>$dirBase\\PSData_mwd_21");binmode (FileOut);...
print FileOut "$stid $rlat $rlon $tim $nlev $nflag\n" ;...
Well now... What do you get in PSData_m
es=;To:for () {push @lines, chomp($_)}orpush(@linesm chomp($_)) for ();
Try that.
or
@lines = ;
chomp @lines;
--
pDale
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe
only affect is 'print FH "\n";' will output '\n' and not '\r\n' to the file, right?
Do 'binmode( FH);' after you open the file but before you write.
You might wanna post sample code and say what you expect and what you get.
--
pDale
"It is h
y any process on the system.
> (I have not tried this in Perl, but I've used it in many windows apps.)
Is there a Unix implementation of that? Otherwise, I think
use IPC::Shareable;
is his best bet.
--
pDale
Eternal small demon
___
ActivePerl m
-"
> (without quotes).
s/^[^-]*-//g;
Should handle abc-123 or -1234 and give you 123 or 1234.
The 'g' modifier (repeat conversion while matches exist) is both
undesired and impotent in this instance.
--
pDale Campbell
"Your water belongs to the tribe."
__
quotes).
$title =~ s/^[^-]*-//;
--
pDale Campbell
"Come to think of it, there are already
a million monkeys on a million typewriters,
and Usenet is NOTHING like Shakespeare."
-- Blair Houghton (1993?)
___
ActivePerl mailing list
ActivePerl@listserv.Active
ess :";
my $ans = <>;
my $mark = [gettimeofday];
my $tdiff = tv_interval( $begin, $mark);
printf( "It took you %5.2f seconds to respond\n", $tdiff);
--
HTH,
pDale
___
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://l
$Bill Luebkert wrote:
pDale Campbell wrote:
I think I remember seeing this discussed in _The_C/C++_Uuser's_Journal_
or _Dr_Dobbs_Journal_: Use ++var unless you *need* the pre-incr value,
because it's less efficient to preserve the old value "through" the
increment. This i
38 matches
Mail list logo