Re: File writing help

2006-07-15 Thread pDale
`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

Re: Regexp substitution

2006-07-15 Thread pDale
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

Re: Regexp substitution

2006-07-14 Thread pDale
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... > > > &

Regexp substitution

2006-07-14 Thread pDale
/$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

Re: system vs. eval vs. backticks?

2006-07-11 Thread pDale
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

Re: Debugging Perl Code Dynamically - howto?

2006-07-10 Thread pDale
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

Re: Regular expression question

2006-07-07 Thread pDale
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:

Re: Regular expression question

2006-07-06 Thread pDale
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

Re: Regular expression question

2006-07-06 Thread pDale
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#/#

Re: Again query with hashes!!!

2006-07-05 Thread pDale
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

Re: font size and color

2006-05-19 Thread pDale
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

Re: font size and color

2006-05-17 Thread pDale
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

Re: Need help with IMG tag containing unbalanced parentheses

2006-05-16 Thread pDale
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

Re: Need help with IMG tag containing unbalanced parentheses

2006-05-16 Thread pDale
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

Re: keys to hashref built from DBI

2006-03-28 Thread pDale
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

Re: keys to hashref built from DBI

2006-03-28 Thread pDale
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

Re: He's at it again!

2006-02-01 Thread pDale
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

Re: activeperl mailing list

2005-12-31 Thread pDale
{$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-

Re: Invoking perl scripts automatically based on time of day

2005-12-14 Thread pDale
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

Re: Ah, another flame war in the making...

2005-11-21 Thread pDale
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

Re: Ah, another flame war in the making...

2005-11-21 Thread pDale
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

Re: importing scalars into an other script

2005-11-04 Thread pDale
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:

Re: Warnings error message

2005-10-12 Thread pDale
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

Re: Top posting

2005-10-04 Thread pDale
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

Re: Top posting

2005-10-04 Thread pDale
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

Re: Top posting

2005-10-04 Thread pDale
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

Re: Top posting

2005-10-04 Thread pDale
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

Re: Top posting

2005-10-04 Thread pDale
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

Re: Top posting

2005-10-04 Thread pDale
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

Re: Pack command

2005-10-04 Thread pDale
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

Re: Fw: writing file in binary mode

2005-09-08 Thread pDale
@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

Re: writing file in binary mode

2005-09-08 Thread pDale
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

Re: writing file in binary mode

2005-09-08 Thread pDale
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

Re: Sharing Variables among Processes...

2005-08-24 Thread pDale
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

Re: RegExp help

2005-03-16 Thread pDale Campbell
-" > (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." __

Re: RegExp help

2005-03-16 Thread pDale Campbell
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

Re: can anyone help me come up with elapsed time?

2004-07-28 Thread pDale Campbell
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

Re: ++$counter or $counter++?

2004-07-01 Thread pDale Campbell
$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