[21913] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4118 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 14 14:13:30 2002

Date: Thu, 14 Nov 2002 08:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 14 Nov 2002     Volume: 10 Number: 4118

Today's topics:
        -F works on command line but not on #!perl -paF line (Amir Karger)
    Re: -F works on command line but not on #!perl -paF lin news@roaima.freeserve.co.uk
    Re: [Q] Script to search auction sites? (Sir Loin of Beef)
    Re: code comprehension tools <rereidy@indra.com>
    Re: Do not wait for system(...) to finish edgue@web.de
        format string being interpretted as perl code? (Nestor Dutko)
    Re: format string being interpretted as perl code? news@roaima.freeserve.co.uk
    Re: Getting "locate" error but library does exist <jhalpin@nortelnetworks.com_.nospam>
    Re: help!! getting the value from hash's hash!! <usenet@tinita.de>
    Re: installing perl on winxp <wsegrave@mindspring.com>
    Re: installing perl on winxp edgue@web.de
    Re: installing perl on winxp (M Browning)
    Re: installing perl on winxp (Helgi Briem)
        Leaving a character OUT of a regexp <torvill@trolldata.no>
    Re: Leaving a character OUT of a regexp <usenet@tinita.de>
    Re: Leaving a character OUT of a regexp <cingram@pjocsNOSPAMORHAM.demon.co.uk>
        multi-file search/replace? (George Eccles)
    Re: multi-file search/replace? <usenet@tinita.de>
    Re: Passing an OLE object to another OLE object (Hyer)
    Re: Perl CGI/DB advice. <flavell@mail.cern.ch>
    Re: sendmail: error email <anthony.heuveline@wanadoo.fr>
    Re: Why does tr/A-Za-z/ /cs; strip all ' characters? news@roaima.freeserve.co.uk
    Re: Windows and nonblocking IO edgue@web.de
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 14 Nov 2002 06:34:10 -0800
From: amirkargerweb@yahoo.com (Amir Karger)
Subject: -F works on command line but not on #!perl -paF line
Message-Id: <87671b7a.0211140634.2ed923d9@posting.google.com>

Pardon if this is a FAQ, but searching for "-F" or "split" on google
groups doesn't help much, and I could swear I'm following the docs. I
can't seem to figure out how to use -F on the #! line, even though it
works fine on the command line.
 
foo% perl -palF/:/ -e '$_=join"_",@F'
1:2:3
1_2_3

foo% more a.pl
#!/usr/local/bin/perl -palF/:/
$_=join"_",@F;
foo% perl a.pl
Scalar found where operator expected at a.pl line 2, at end of line
        (Missing semicolon on previous line?)
syntax error at a.pl line 2, near "$_"
Execution of a.pl aborted due to compilation errors.

foo% chmod +x a.pl
foo% a.pl
1:3:4
1_3_4

I've tried all manner of -F/x/, -Fx, -F"x", putting the -F in
different places on the line, splitting on different regexes,
whatever. I either get errors or in rare cases no output. It happens
on ActivePerl5.6.1 as well as Solaris Perl5.005_03. Also, if I get rid
of the -F, then it works fine, splitting on whitespace.

I would think this would be a popular bug, and I can't imagine why I
haven't found it mentioned. In fact, I've even seen Perl golf results
using it. (Perl golf is why I can't just do a split in the text of the
script and avoid this issue. The scripts are run by the judges as
"perl a.pl".)

Help!

-Amir Karger


------------------------------

Date: Thu, 14 Nov 2002 16:00:10 +0000
From: news@roaima.freeserve.co.uk
Subject: Re: -F works on command line but not on #!perl -paF line
Message-Id: <aah0ra.vtl.ln@moldev.cmagroup.co.uk>

Amir Karger <amirkargerweb@yahoo.com> wrote:
> Pardon if this is a FAQ, but searching for "-F" or "split" on google
> groups doesn't help much, and I could swear I'm following the docs. I
> can't seem to figure out how to use -F on the #! line

> foo% more a.pl
> #!/usr/local/bin/perl -palF/:/
> $_=join"_",@F;

> The scripts are run by the judges as "perl a.pl"

In this case you don't need a (valid) path to perl on the #! line, so
you can remove the "/usr/local/bin/" prefix and save yourself a number
of characters.

Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


------------------------------

Date: Thu, 14 Nov 2002 13:59:05 GMT
From: NOSPAMmdknight@pacific.net.sg (Sir Loin of Beef)
Subject: Re: [Q] Script to search auction sites?
Message-Id: <3dd3abf4.12435877@news.pacific.net.sg>

Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:

>You could start by *really* fixing the syntax error.
>Next, you should enable warnings and strictures by putting the
>following two lines under the shebang:

Hi..
sorry about that, I missed out something when copying code to the
newsgroup. There's no syntax error now, nor are there any compilation
errors. What I need to know is how I can substitute the real value of
mySearchTerm in the url, rather than passing it as a literal.



> use CGI qw/:standard/;
>   print header,
>         start_html('Auction search'),
>         h1('Auction Search'),
>         start_form,
>         "Search Term? ",textfield('mySearchTerm'),p,
>         "What's the combination?", p,
>         checkbox_group(-name=>'words',
> 		       -values=>['Yahoo Sg','Interauct'],
> 		       -defaults=>['Interauct']), p,
>         submit,
>         end_form,
>         hr;
> 
>    if (param()) {
>        print "Searching for search term: ",em(param('name')),p,
> 	     "on auction sites: ",em(join(", ",param('words'))),p,
> 	     hr;
> 	$content =
> get("http://www.interauct.com.sg/searcheng/auc?region=1&item=mySearchTerm");
> 
> 	print $content;
> 


------------------------------

Date: Thu, 14 Nov 2002 06:00:24 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: code comprehension tools
Message-Id: <3DD39E68.FCF64E34@indra.com>

NKarun wrote:
> 
> Hello,
> 
> I have a relatively large Linux web application written in C, Perl and shell
> scripts. Are there any tools/techniques/methodologies that can help me
> understand this application?
> Thanks
> NK
use Your::Mind;
-- 
Ron Reidy
Oracle DBA


------------------------------

Date: Thu, 14 Nov 2002 12:19:02 +0100
From: edgue@web.de
Subject: Re: Do not wait for system(...) to finish
Message-Id: <3DD386A6.9020604@web.de>



Jürgen Exner wrote:

> However, be careful. Each loop will create a new process, so if you have a
> large number of $rechner values (i.e. a lot of loops) you may swamp the
> computer.

That is not 100% correct. fork() doesnt really create a
new process on Windows. It will fake a new process but in reality it
will create a new thread and tell you - he thats your new process.
You have to use the Win32::Process module for a real new process.




------------------------------

Date: 14 Nov 2002 04:36:32 -0800
From: nestor@ndutko.com (Nestor Dutko)
Subject: format string being interpretted as perl code?
Message-Id: <8001a431.0211140436.25125987@posting.google.com>

I have a perl module that is trying to construct html. I know I can
use the CGI perl module, but this code is easier to maintain as all I
need to do is use a html editor and format the code then dump the
section into the perl module.

What I get is:

syntax error at t.pl line 35, near "){"
Execution of t.pl aborted due to compilation errors.

The perl itself is (I have made certain there are no '@' or '^'
characters. It is interesting that perl seems to be interpretting the
code. Is there something that triggered this or an ability to turn it
off?

Thanks!
Nestor

#! perl
use strict vars;

format HTML =
);

overdiv="0";
//  #########  CREATES POP UP BOXES 
function popLayer(a){
if(!descarray[a]){descarray[a]="<font color=red>This popup (#"+a+")
isn't setup correctly - needs description</font>";}
if (navigator.family == "gecko") {pad="0"; bord="1
bordercolor=black";}
else {pad="1"; bord="0";}
desc = 	  "<table cellspacing=0 cellpadding="+pad+" border="+bord+" 
bgcolor=000000><tr><td>\n"
	+"<table cellspacing=0 cellpadding=3 border=0 width=100%><tr><td
bgcolor=ffffdd><center><font size=-1>\n"
	+descarray[a]
	+"\n</td></tr></table>\n"
	+"</td></tr></table>";
if(navigator.family =="nn4") {
	document.object1.document.write(desc);
	document.object1.document.close();
	document.object1.left=x+15;
	document.object1.top=y-5;
	}
else if(navigator.family =="ie4"){
	object1.innerHTML=desc;
	object1.style.pixelLeft=x+15;
	object1.style.pixelTop=y-5;
	}
else if(navigator.family =="gecko"){
	document.getElementById("object1").innerHTML=desc;
	document.getElementById("object1").style.left=x+15;
	document.getElementById("object1").style.top=y-5;
	}
}
function hideLayer(){
if (overdiv == "0") {
	if(navigator.family =="nn4") {eval(document.object1.top="-500");}
	else if(navigator.family =="ie4"){object1.innerHTML="";}
	else if(navigator.family =="gecko")
{document.getElementById("object1").style.top="-500";}
	}
}

//  ########  TRACKS MOUSE POSITION FOR POPUP PLACEMENT
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
//  End -->
</script>
</head>

<body>
<div id="object1" style="position:absolute;
background-color:FFFFDD;color:black;border-color:black;border-width:20;
visibility:show; left:25px; top:-100px; z-index:+1"
onmouseover="overdiv=1;"  onmouseout="overdiv=0;
setTimeout('hideLayer()',1000)">
pop up description layer
</div>

<div align="center">
  <p><font size="+1"><strong><font color="#0000FF" face="Arial,
Helvetica, sans-serif">UI
    Page Performance Atomics</font></strong></font> <br>
    <font face="Courier New, Courier,
mono">EMDW_4.0.0_SOLARIS_021112</font> <br>
    <font size="-1" face="Courier New, Courier, mono"><em>Generated:
November
    12, 2002</em></font></b>
	<br>
	<br>
  <table width="90%" border="1">
    <tr bgcolor="#CCCCCC"> 
      <td width="51%"> <div align="center"><font color="#000000"
size="-1"><strong><font face="Georgia, Times New Roman, Times,
serif">Page
          Name</font></strong></font></div></td>
      <td width="7%"><div align="center"><strong><font color="#000000"
size="-1" face="Georgia, Times New Roman, Times, serif">#
          of Samples</font></strong></div></td>
      <td width="10%"><div align="center"><strong><font
color="#000000" size="-1" face="Georgia, Times New Roman, Times,
serif">Avg
          download Time (sec)</font></strong></div></td>
      <td width="6%"><div align="center"><strong><font color="#000000"
size="-1" face="Georgia, Times New Roman, Times, serif">Max
          Download time (sec)</font></strong></div></td>
      <td width="8%"><div align="center"><strong><font color="#000000"
size="-1" face="Georgia, Times New Roman, Times, serif">Download
          Time (StdDev) </font></strong></div></td>
      <td width="9%"><div align="center"><strong><font color="#000000"
size="-1" face="Georgia, Times New Roman, Times, serif">Avg
          HTML base generation (sec)</font></strong></div></td>
      <td width="9%"><div align="center"><strong><font color="#000000"
size="-1" face="Georgia, Times New Roman, Times, serif">Avg
          Image Download time (sec)</font></strong></div></td>
    </tr>
    <tr> 
 .


------------------------------

Date: Thu, 14 Nov 2002 15:44:39 +0000
From: news@roaima.freeserve.co.uk
Subject: Re: format string being interpretted as perl code?
Message-Id: <7dg0ra.vtl.ln@moldev.cmagroup.co.uk>

Nestor Dutko <nestor@ndutko.com> wrote:
> I have a perl module that is trying to construct html. I know I can
> use the CGI perl module, but this code is easier to maintain [...]

It may be easier to maintain but it doesn't (and can't) work. There's
no reason why you should mix'n'match CGI.pm with directly written HTML
(in fact, for many cases it's an easier approach than using CGI.pm
exclusively).

> It is interesting that perl seems to be interpretting the
> code. Is there something that triggered this or an ability to turn it
> off?

Yes. You're using "format". Perl has to interpret the format string in
order to know where to interpolate variables (whether or not you specify
any). Perl doesn't understand EMCAScript (JavaScript), hence the error.

Consider replacing the "format" with a here-doc.

    my $HTML = <<'.';
    	lots of html here
	and here
	and here
    .

    print $HTML;

Have you considered using templates (e.g. HTML::Template) to separate
code and content properly?

Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


------------------------------

Date: 14 Nov 2002 08:30:34 -0600
From: Joe Halpin <jhalpin@nortelnetworks.com_.nospam>
Subject: Re: Getting "locate" error but library does exist
Message-Id: <yxs7n0ocmdf9.fsf@nortelnetworks.com_.nospam>

Time Vest Insurance <reb@timevest.com> writes:

> I'm getting this error message when I do a perl -c
> 
> Can't locate loadable object for module Sybase::DBlib in @INC (@INC
> contains: /usr/local/lib/perl5/5.8.0/sun4-solaris
> /usr/local/lib/perl5/5.8.0
> /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris 
> /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) at
> /usr/local/lib/perl5/site_perl/Utils.pm line 22 Compilation failed
> in require at /usr/local/lib/perl5/site_perl/Utils.pm line 22.
> BEGIN failed--compilation aborted at
> /usr/local/lib/perl5/site_perl/Utils.pm line 22.  Compilation failed
> in require at index.cgi line 9.  BEGIN failed--compilation aborted
> at index.cgi line 9.
> 
> There does exist /usr/local/lib/perl5/site_perl/Sybase/DBlib.pm
> 
> It is readable

It's not in the @INC path that you show though. Try using 

use lib '/usr/local/lib/perl5/site_perl/Sybase';

And check with the admin to find out why the upgrade didn't get this
into @INC.

Joe


------------------------------

Date: 14 Nov 2002 11:22:19 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: help!! getting the value from hash's hash!!
Message-Id: <ar011b$dp234$1@fu-berlin.de>

Louis <louiskkchan@hotmail.com> wrote:
> I have a package like this:
> ####### use hash to store inventory with '-monitor' and '-keyboard'
> key inside
> package config;

> %inventory = { 
>   "machineA" => {
>     -monitor => "nec",
>     -keyboard => "nobrand",
>   },
>   "machineB" => {
>     -monitor => "topcon",
>     -keyboard => "ibm",
>   },
>   "laptopA" => {
>     -monitor => "philips",
>     -keyboard => "built-in",
>   },
> };
> #######

always enable warnings! (with -w or "use warnings"):
Reference found where even-sized list expected at -e line 3.

%inventory contains now a key like 'HASH(0x8113380)' and a value
which is undef.
use Data::Dumper;
print Dumper \%inventory;

perldoc perllol, perldoc perldsc

> how can i refer '%inventory' by using it as package "require
> inventory.cfg". also, how can i get 'machine name' and
> -monitor/-keyboard info?

%config::inventory;
$condig::inventory{machineA}{-monitor}
etc.

perldoc perlmod

hth, tina
-- 
http://www.tinita.de/        \  enter__| |__the___ _ _ ___
http://Movies.tinita.de/      \     / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/   \    \ _,_\ __/\ __/_| /__/ perception


------------------------------

Date: Thu, 14 Nov 2002 06:54:46 -0600
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: installing perl on winxp
Message-Id: <ar06pq$khf$1@slb6.atl.mindspring.net>

"thebladerunner" <thebladerunner@xmission.com> wrote in message
news:aqv19r$phb$1@terabinaries.xmission.com...
> I have a question about using perl on a winxp machine that I have at work.
I
> used to have a win2k machine that I was a poweruser on and this wasn't a
> problem. On the new machine I am only a user. After attempting an
> installation of the latest version of ActiveState Perl I cannot run any
perl
> scripts.  Perl does not have a proper PATH environment set-up and even if
I
> coax it a bit I still can't get any modules to work.
>
> Does anyone have any advice about how to work around this problem?  I'm
> about to the point of bringing my Debian laptop to work and telling my
> company they can stick this XP box.

You might try installing IndigoPerl, www.indigostar.com, on your XP box. It
worked fine when I did this on my son's (similar) XP system.

Bill Segraves




------------------------------

Date: Thu, 14 Nov 2002 14:07:05 +0100
From: edgue@web.de
Subject: Re: installing perl on winxp
Message-Id: <3DD39FF9.9050106@web.de>



thebladerunner wrote:
> Does anyone have any advice about how to work around this problem?  I'm
> about to the point of bringing my Debian laptop to work and telling my
> company they can stick this XP box.

What you could do:
- get the ActiveState installer and install the complete
   thing on another machine where you can do it
- simply zip the whole Perl-direcotry tree together
- copy the zip file to your XP machine
- unzip
- set the necessary env variables:
   PERL5LIB=E:\Perl\site\lib
   PATH= ...;E:\Perl\bin

Works for me.
I guess you need some more tuning to register the .pl file extension.
But that should be doable, too.



------------------------------

Date: 14 Nov 2002 05:51:30 -0800
From: m.browning@plymouth.ac.uk (M Browning)
Subject: Re: installing perl on winxp
Message-Id: <eddc4731.0211140551.6c4ce60e@posting.google.com>

"thebladerunner" <thebladerunner@xmission.com> wrote in message news:<aqv19r$phb$1@terabinaries.xmission.com>...
> I have a question about using perl on a winxp machine that I have at work. I
> used to have a win2k machine that I was a poweruser on and this wasn't a
> problem. On the new machine I am only a user. After attempting an
> installation of the latest version of ActiveState Perl I cannot run any perl
> scripts.  Perl does not have a proper PATH environment set-up and even if I
> coax it a bit I still can't get any modules to work.
> 
> Does anyone have any advice about how to work around this problem?  I'm
> about to the point of bringing my Debian laptop to work and telling my
> company they can stick this XP box.
> 

Um, you are a Win2k `poweruser' who has managed to install Debian on a
laptop but you can't set up a file association on Windows?

From memory:  can't you just click on a script you've saved and then
browse to the perl executable from the `Open with...' thingy?

How do you know that you `can't get any modules to work'?

I reckon this thread should be on comp.windows.setup or somesuch.


------------------------------

Date: Thu, 14 Nov 2002 15:55:56 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: installing perl on winxp
Message-Id: <3dd3c762.2551564425@news.cis.dfn.de>

On Thu, 14 Nov 2002 06:54:46 -0600, "William Alexander
Segraves" <wsegrave@mindspring.com> wrote:

>"thebladerunner" <thebladerunner@xmission.com> wrote in message
>news:aqv19r$phb$1@terabinaries.xmission.com...
>> I have a question about using perl on a winxp machine that I have at work.
>I
>> used to have a win2k machine that I was a poweruser on and this wasn't a
>> problem. On the new machine I am only a user. After attempting an
>> installation of the latest version of ActiveState Perl I cannot run any
>perl
>> scripts.  Perl does not have a proper PATH environment set-up and even if
>I
>> coax it a bit I still can't get any modules to work.
>>
>> Does anyone have any advice about how to work around this problem?  I'm
>> about to the point of bringing my Debian laptop to work and telling my
>> company they can stick this XP box.
>
>You might try installing IndigoPerl, www.indigostar.com, on your XP box. It
>worked fine when I did this on my son's (similar) XP system.

No, if he is only an ordinary user he is not allowed to
set up any programs.  He has to ask the administrator
to allow him to do that.  
-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


------------------------------

Date: Thu, 14 Nov 2002 12:32:28 +0100
From: "Anders Torvill Bjorvand" <torvill@trolldata.no>
Subject: Leaving a character OUT of a regexp
Message-Id: <1037273001.285101@a217-118-32-43.bluecom.no>

Hi,

I am trying to have a regexp that match an html-parameter.
In my case, this is an equality sign, a quote, the content and an ending
quote.

In regexp form, it is:
/="[all characters except a quote]*"/

My problem is the part in the middle: all characters except a quote - how
can I perform that - i.e. to exclude a character from a character class - in
this case I would like to match anything BUT a quote.

Hints anyone?

Sincerely,
Anders T. B.




------------------------------

Date: 14 Nov 2002 11:45:10 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: Leaving a character OUT of a regexp
Message-Id: <ar02c6$e1dm8$1@fu-berlin.de>

Anders Torvill Bjorvand <torvill@trolldata.no> wrote:

> I am trying to have a regexp that match an html-parameter.
> In my case, this is an equality sign, a quote, the content and an ending
> quote.

> In regexp form, it is:
> /="[all characters except a quote]*"/

have you heard of the really great perl documentation?
perldoc perlre

[^"]

also read: perldoc -q html

hth, tina
-- 
http://www.tinita.de/        \  enter__| |__the___ _ _ ___
http://Movies.tinita.de/      \     / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/   \    \ _,_\ __/\ __/_| /__/ perception


------------------------------

Date: Thu, 14 Nov 2002 12:04:35 -0000
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Re: Leaving a character OUT of a regexp
Message-Id: <ar03e8$7gi$1$830fa17d@news.demon.co.uk>

Anders,

"Anders Torvill Bjorvand" <torvill@trolldata.no> wrote in message
news:1037273001.285101@a217-118-32-43.bluecom.no...
> My problem is the part in the middle: all characters except a quote - how
> can I perform that - i.e. to exclude a character from a character class -
in
> this case I would like to match anything BUT a quote.

Possibly:

/="[^"]*"/

Inside a character class [ . . . ], the leading meta-character ^ negates the
class.
Check out perlre.
Also Master Regular Expressions - O'Reilly.

Regards,
Clyde




------------------------------

Date: Thu, 14 Nov 2002 15:21:58 GMT
From: eccles@a-znet.com (George Eccles)
Subject: multi-file search/replace?
Message-Id: <3dd3bd01.1077394441@news.a-znet.com>

running perl, version 5.005_03 built for MSWin32-x86-object
on Win NT4

I would like to be able to do a (wildcard) mult-file search/replace
from the command line, as in 

   > funcname s/_pattern_/_replace_/  *.

The command line

   > perl -p -i.bck "s/_pattern_/_replace/"  (file_list)

does a multi-file find/replace, but requires a file list.  I can glob
($ARGV[0]) to produce a file list, but haven't found a way to use that
ias input for the above command line.  I would prefer to avoid writing
a whole script (with error-handling, etc), when the above command line
so nearly does what I want.

If there is a way to to get this to work, I would appreciate hearing
of it.  ... or any other comments.

thanks,
George




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


------------------------------

Date: 14 Nov 2002 15:32:54 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: multi-file search/replace?
Message-Id: <ar0fn6$eanga$2@fu-berlin.de>

George Eccles <eccles@a-znet.com> wrote:
> running perl, version 5.005_03 built for MSWin32-x86-object
> on Win NT4

> I would like to be able to do a (wildcard) mult-file search/replace
> from the command line, as in 

>    > funcname s/_pattern_/_replace_/  *.

> The command line

>    > perl -p -i.bck "s/_pattern_/_replace/"  (file_list)

> does a multi-file find/replace, but requires a file list.  I can glob

that's the wrong syntax.
try:
perl -pi.bck -e 's/.../.../" *.

for more info read perldoc perlrun

hth, tina

-- 
http://www.tinita.de/        \  enter__| |__the___ _ _ ___
http://Movies.tinita.de/      \     / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/   \    \ _,_\ __/\ __/_| /__/ perception


------------------------------

Date: 14 Nov 2002 07:04:01 -0800
From: hyer_bercaw@hotmail.com (Hyer)
Subject: Re: Passing an OLE object to another OLE object
Message-Id: <671b9222.0211140704.6cafa9f7@posting.google.com>

Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3DD33828.BA0CFBB7@earthlink.net>...
> Hyer wrote:
> [snip]
> > Here are key parts of the VB example:
> > Set objQuery = CreateObject("ProductStudio.Query")
> > Set objFields = objDataStore.FieldDefinitions
> > ' Specify the fields to be returned
> > objQuery.QueryFields.Add objFields("ID")
> > 
> > Now in Perl:
> > $objQuery = Win32::OLE->new('ProductStudio.Query');
> > $objFields = $objDataStore->FieldDefinitions;
> > #Specify the fields to be returned
> > $objQuery->QueryFields->Add("$objFields->Item('Title')");
> 
> Why do you have "" quotes around the thing?  What happens with:
> 
>    $objQuery->QueryFields->Add( $objFields->Item('Title') );
> 
> Also, in your VB example, you've got "ID", and in your perl example,
> you've got "Title".  Why the change?

If you remove the "" it works. That would be too simple. Sorry folks.
I tried it 60,000 ways and I was pretty sure that I had tried it
without the quotes. Thanks very much for your help. It is very nice to
see that Perl handles this so well.


------------------------------

Date: Thu, 14 Nov 2002 15:15:34 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl CGI/DB advice.
Message-Id: <Pine.LNX.4.40.0211141509060.23615-100000@lxplus074.cern.ch>

On Nov 14, Benjamin Goldberg inscribed on the eternal scroll:

> According to RFC 2616:
>
>    A client SHOULD detect infinite redirection loops, since
>    such loops generate network traffic for each redirection.

Indeed, that is a wise piece of advice to client implementers.

But even if it went further than to offer advice, and made it a
mandatory requirement, I would say - from the point of view of a
server/script implementer - it would be crazy to leave your server at
the mercy of any client which disregarded the requirement.

When implementing this technique, one should clearly put something
extra token into the query string or path_info at the same time as
hurling the cookie; then if the same script URL finds itself being
accessed with the extra token but without a cookie, then it knows that
the user turned cookies off, and should take an appropriate action -
by which I don't mean simply redirecting again with a fresh cookie in
the hope that things might miraculously change!

cheers



------------------------------

Date: Thu, 14 Nov 2002 15:03:04 +0100
From: "Anthony" <anthony.heuveline@wanadoo.fr>
Subject: Re: sendmail: error email
Message-Id: <ar0aeo$m8e$1@news-reader11.wanadoo.fr>

I'm sorry but each message I posted about sendmail was dealing with
different aspects of this program.

I posted these questions on this forum because I wanted to ask them to
persons who know about Perl specificities in using sendmail.


"Brian McCauley" <nobull@mail.com> a écrit dans le message de news:
u97kfgzcw0.fsf@wcl-l.bham.ac.uk...
> "Anthony" <anthony.heuveline@wanadoo.fr> writes for the third time...
>
> [essentially the same thing he's asked twice already ]
>
> Stop it!  You are being rude.
>
> If you want to refine a question you've already asked then post a
> follow-up.  Do not start new theads.  Read responses.  If the response
> doesn't fully answer your question then follow-up the response
> explaining why it doesn't and ask a supplementary question.
>
> >     I saw somewhere in a forum that when sendmail is used with the
delivery
> > mode set to -o di, the sender which is declared in $From receives an
error
> > email when the email address of destination doesn't exist or is invalid.
>
> This, IIRC, is confused but in no way related to Perl.  In fact you've
> got it backwards.  Rather than finding information "somewhere in a
> forum" perhaps you should check the manual. The effect -odi of is that
> (wherever possible) errors are returned via sendmail's STDERR and exit
> status and _not_ by mail.
>
> Errors returned by mail are retured to the envelope-From address (also
> known as the return path) not the header-From address.  Under normal
> sendmail configurations the -t switch does _not_ set the envelope-From
> set by parsing the header-From.  You can specify the envelope-From
> with the -f command line option.
>
> All this has nothing to do with Perl.  You must know this.  Why to you
> persist in posting to a Perl newsgroup?
>
> --
>      \\   ( )
>   .  _\\__[oo
>  .__/  \\ /\@
>  .  l___\\
>   # ll  l\\
>  ###LL  LL\\




------------------------------

Date: Thu, 14 Nov 2002 11:31:11 +0000
From: news@roaima.freeserve.co.uk
Subject: Re: Why does tr/A-Za-z/ /cs; strip all ' characters?
Message-Id: <vh10ra.jqe.ln@moldev.cmagroup.co.uk>

Rubber Duck <rubberducky703@hotmail.com> wrote:
> I got given this code but it converts o'harold to oharold why does it do
> this and how can i stop it??

>     tr/A-Za-z/ /cs;

Look at the documentation for the commands:
	perldoc -f tr

Which points you to the y// operator in:
	perldoc perlop

Specifically, look at the option characters to see what they do.
Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


------------------------------

Date: Thu, 14 Nov 2002 12:10:40 +0100
From: edgue@web.de
Subject: Re: Windows and nonblocking IO
Message-Id: <3DD384B0.1030905@web.de>



Benjamin Goldberg wrote:
> I would suggest you report it using perlbug.  (Give a *minimal* perl
> script which shows this).

I am not sure if it is really a bug. Active Perl 5.6.1 reacted in the
same way: you called blocking(1) - and no error information; simply
failing ...




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 4118
***************************************


home help back first fref pref prev next nref lref last post