[15589] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3002 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 10 09:05:34 2000

Date: Wed, 10 May 2000 06:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <957963911-v9-i3002@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 10 May 2000     Volume: 9 Number: 3002

Today's topics:
    Re: #How to parse and strip perl comments? <phill@modulus.com.au>
        'use integer' causes strange output.. <justin@comms81.freeserve.co.uk>
    Re: Help Needed  - Perl Matching Operator <jakemsr@earthlink.net>
        How to "su" in perl? <jagman98@home.com>
    Re: How to "su" in perl? <rhomberg@ife.ee.ethz.ch>
    Re: How to make a grep utility for Win32 (Lars Gregersen)
        how to use fork or background processing (in Perl/Tk)? <michael.schlueter@philips.com>
        Inserting text in a chart scarey_man@my-deja.com
    Re: Iterating an array question? (Bart Lateur)
        MS Access OLE with Perl jac239750@my-deja.com
    Re: NetworkSolutions - example of lapse security nobull@mail.com
        not in find/replace expressions <kmojar@bmjgroup.com>
    Re: not in find/replace expressions nobull@mail.com
        open/sysopen whitespace (David Watson)
    Re: perl in NT .BAT files Question <sturdevr@yahoo.com>
    Re: Please check my 'random' code <ra_jones@my-deja.com>
    Re: Please check my 'random' code <ra_jones@my-deja.com>
    Re: Printing Arrays (Bart Lateur)
    Re: Printing Arrays <billy@arnis-bsl.com>
    Re: Puzzle: DESTROY not destroying (Bart Lateur)
    Re: regular expression: how do I accept +integers or +f (Tad McClellan)
    Re: Socket Question- (Lars Gregersen)
    Re: sort a two-dimensional array.... <billy@arnis-bsl.com>
    Re: Strange Characters from Perl Script <david.guiney@detini.gov.uk>
        URGENT HELP WITH REGEXP REQUIRED vlad55@my-deja.com
    Re: URGENT HELP WITH REGEXP REQUIRED (Bart Lateur)
        Win32 SYSTEM window <stuart.tavener@greenwichnatwest.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 10 May 2000 22:07:08 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: #How to parse and strip perl comments?
Message-Id: <391950EC.11BF@modulus.com.au>

[snip]
> >>
> >> That begs the question, why can't production code have comments?
> >>
> >> Abigail
> > No reason, indeed. But nor does it beg the question. I want to strip the
> > existing comments which are excessive,
> 
> Yeah but I have programs with comments like :
> 
>    When I could see again the driver was climbing into the
>    caleche, and the wolves disappeared. This was all so strange
>    and  uncanny that  a  dreadful  fear came upon me, and I was
>    afraid to speak or move.  The time seemed interminable as we
>    swept on our way, now in almost  complete darkness,  for the
>    rolling clouds obscured the moon.
> 
> And I would be very upset if that was removed as it says more about the
> code it is from than any 'appropriate' comments.
> 
> /J\
> --
> Safety? But sir! If truth be known, I actually caused more accidents
> around here than any other employee, including a few doozies no one
> every found out about.
> --
> fortune oscar homer
You're right, of course, how could you argue with an educated gentleman
who quotes Homer?
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Wed, 10 May 2000 11:56:01 +0100
From: "Justin Wyllie" <justin@comms81.freeserve.co.uk>
Subject: 'use integer' causes strange output..
Message-Id: <8fbfgf$69g$1@newsg3.svr.pol.co.uk>

Hi

I've got the following line in my code:

use integer;

This pragma (I'm none too sure what a pragma is I have to admit being new to
this) forces my
calculations to return integer values eg. 8 / 3 results in 2 not 2.666667.

This all works fine when I run my code under my active state port of perl
for win32. But when  I run the same script, which contains this line, on my
ISP's server (Linux) I get a scrambled result. The html page is returned but
the text is corrupt in strange ways eg. a mailto: url seems to have been
inserted where my style sheet href was supposed to be & half the page is
missing. I am using CGI.pm as
you probably guessed.

I have checked with the ISP & they think that the integer package is ok and
installed properly. They thought there might be a command line option I need
to set to turn pragmas on.

Your help greatly appreciated.

Thanks

Justin Wyllie
email to; jwyllie81@cs.com







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

Date: Wed, 10 May 2000 11:39:56 GMT
From: "jake" <jakemsr@earthlink.net>
Subject: Re: Help Needed  - Perl Matching Operator
Message-Id: <gUbS4.47393$g4.1299874@newsread2.prod.itd.earthlink.net>


"Kelvin" <k2_1999@hotmail.com> wrote in message
news:Vv%R4.7203$%u6.427214@news1.telusplanet.net...
> I'm little confusing of how to use the matching operator in perl!
> I'm writing a function to check if the user enter a valid email address,
> but I don't sure how to use the m// operator.
>
> sub checkemail {
>     $_ = $enteredEmail;
>     m/"@"//;
> }
> is that correct?
> Or how can I make sure the $enteredEmail included a "@" in it?
>
> Thanks in Advance!
> Kelvin
> kelvinsun@hotmail.com
>
>
>
Although all the replies to this post are all interesting, no one pointed
out that you shouldn't use quotation marks, unless you explicitly want to
match quotation marks.
/"\@"/ is different than /\@/. And no one explained the backslash excape.
/@/ -> wrong   /\@/ -> right

/"@"/ is a lot different than /@/ which is different than




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

Date: Wed, 10 May 2000 12:21:39 GMT
From: JagMan <jagman98@home.com>
Subject: How to "su" in perl?
Message-Id: <39195524.C954803@home.com>

I am trying to execute "su" command in perl with password.  I can't find
any refrance to "su" command on the web.

================
Example:  su - joe
Password:  joe

joe >

================

exec "sh", -c $joefile;    # I am not sure this will work?  with user
joe and             password supplied in file.

Thanks in Advance!
Manny



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

Date: Wed, 10 May 2000 15:03:56 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: How to "su" in perl?
Message-Id: <39195E3C.50DB593A@ife.ee.ethz.ch>

JagMan wrote:
> 
> I am trying to execute "su" command in perl with password.  I can't find
> any refrance to "su" command on the web.

This opens major security holes. If you want to change to a less
privileged user, use setuid from the POSIX module. If you want to do
something which needs more privileges, use su1 or sudo, a suid program,
a deamon or a crontab script.

Don't put passwords in your scripts.

- Alex


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

Date: Wed, 10 May 2000 09:53:34 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: How to make a grep utility for Win32
Message-Id: <39193187.96167766@news.dtu.dk>

On Mon, 08 May 2000 10:30:49 -0400, William Cardwell
<EUSWMCL@am1.ericsson.se> wrote:

>I am trying to write a Perl utility to behave similar to grep for use on
>WIN32. I have tried lots of things including a search for one-liners and
>use of the perl grep function, but can't get very close.

Check out findgrep

  Lars

 ------------------------------
Lars Gregersen (lg@kt.dtu.dk)
http://www.gbar.dtu.dk/~matlg

Check out the Perl search utility findgrep at:
http://members.xoom.com/gregersenweb/


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

Date: Wed, 10 May 2000 13:58:49 +0200
From: "Michael Schlueter" <michael.schlueter@philips.com>
Subject: how to use fork or background processing (in Perl/Tk)?
Message-Id: <8fbiqj$fbi$1@porthos.nl.uu.net>

Hi everybody,

If I'd use fork like is given in "Programming Perl", are there any traps and
pitfalls I could tap into? I intend to use fork/background_jobs with
Perl/Tk.


I think of doing things like:

* when starting up a GUI the user usually has to spend some time anyway. I'd
like to scan and prepare larger datafiles in background in parallel. the
user should notice 'improved speed' from this.

* some calculations will take quite some time. once finished the user should
be informed or the GUI should update automatically. how to do that?

Do I need to care about Signal-processing (Ch. 6 of PP)? Are there
alternatives?


I appreciate your hints, examples and recommendations.
Michael Schlueter






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

Date: Wed, 10 May 2000 10:14:16 GMT
From: scarey_man@my-deja.com
Subject: Inserting text in a chart
Message-Id: <8fbcpg$jp5$1@nnrp1.deja.com>

How do I add text to a chart using the GD::Graph modules?
I want to be able to add text to any coords I specify.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 10 May 2000 10:58:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Iterating an array question?
Message-Id: <391f401f.12943680@news.skynet.be>

aphiny6592@my-deja.com wrote:

>Using
>a foreach construct, how do I iterate the array
>counter to move to the next line without using
>the next command.  I.e.
>
>foreach $item (@array)
>{
>     # how do iterate explicitly
>     $item++;  # ????
>}

Here's another way.

	my $i = 0;
	@array = ('a'..'z');
	foreach $item (grep { ++$i & 1 } @array) {
	    print $item;
	}

-->
	acegikmoqsuwy

-- 
	Bart.


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

Date: Wed, 10 May 2000 12:18:33 GMT
From: jac239750@my-deja.com
Subject: MS Access OLE with Perl
Message-Id: <8fbk2c$rm3$1@nnrp1.deja.com>

Hi

I'm trying to write a small bit of perl to run a
macro I have in an Access database. I can connect
to the db and perform a beep to check, but I cant
get the macro to run. The macro uses RunCode to
call a Function in an Access Module. Any ideas?

Cheers
J.


use Win32::OLE;
$ac = Win32::OLE->new
('Access.Application','Quit');
$ac->OpenCurrentDatabase
("c:\path\to\database.mdb");
$ac->DoCmd->Beep();			# this
works
$ac->DoCmd->RunMacro("macroname");	# this
doesn't!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 10 May 2000 12:11:08 +0100
From: nobull@mail.com
Subject: Re: NetworkSolutions - example of lapse security
Message-Id: <u9d7muirsj.fsf@wcl-l.bham.ac.uk>

"Andy Chantrill" <andy@u2me3.com> writes:

> http://www.networksolutions.com/cgi-bin/makechanges/easysteps/easysteps.pl?S
> TRING=maymun.com.pl?STRING=dmaymun.com&FILE=/../../../../../../../etc/passwd
> 
> Just an example of how CGI scripts can be a major security hazard ...

Any program that is running as a user that has more access to any
resource than the user providing the input to the program has can be a
security hazard.

This includes any programs (regardless of API or language) run by a
web server.

Actually to make a Perl CGI script vulnerable this particular exploit
requires much more willfull stupidity than would a CGI script written
in many other languages.  The information from web forms is tainted so
cannot be used to open a file.  Tainted data only becomes untainted
once you've validated it using a pattern match.

So if this exploit works the CGI script in question is either running
without taint checking or is using a bad pattern to validate the FILE
parameter.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 10 May 2000 12:55:18 +0100
From: Kourosh A Mojar <kmojar@bmjgroup.com>
Subject: not in find/replace expressions
Message-Id: <39194E26.D68A3EC0@bmjgroup.com>

Dear all,

I often use find/replace expressions and now interested in being able
to:

define a find expression that contains some string but not others. for
example I would like to find replace all $lines that contain
<OPTIONTITLE>.+?</OPTIONTITLE> although I would like to ignore if "New"
exists (i.e. <OPTIONTITLE>.+?<B>New</B></OPTIONTITLE>. the contents
".+?" can be varied encapsulated sentence or other tags. As usual if
that made any sense I would very much appreciate any help. Here is the
line of code I am currently using.

if ( $line_in =~ "<OPTIONTITLE
ID=\"(.+?)\">(.+?)</OPTIONTITLE>|<OPTIONTITLE ID=\"(.+?)\">(.+?) ?<font
color=\"#FFFFFF\">(<B>New</B>)</font></OPTIONTITLE>" ) {
	... other stuff ...
	}

Thanking you in advance and for your kind attention,

Kourosh A Mojar
kmojar@bmjgroup.com


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

Date: 10 May 2000 13:23:03 +0100
From: nobull@mail.com
Subject: Re: not in find/replace expressions
Message-Id: <u9aehyiogo.fsf@wcl-l.bham.ac.uk>

Kourosh A Mojar <kmojar@bmjgroup.com> writes:

> define a find expression that contains some string but not others.

This has been discussed here several times in the last few weeks.
Please see those threads.

You can probably do it with negative-lookahead assertions but it would
probably be clearer to use multiple match operators connected with
boolean operators.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 10 May 2000 12:05:06 GMT
From: david.watson@nospamteam17.com (David Watson)
Subject: open/sysopen whitespace
Message-Id: <39194f79.101434073@news.team17.com>


	I'm having dificulty opening a file with what I have below:

$test = "\"temp temp/pp\"";
open(pp,$test) or die "Unable to open pp\n";

I've messed around with different quoting and its definately a
whitespace problem. Given that I cant control the pathname could
someone suggest a solution? If the answer is sysopen could you also
point me to the documentation on the various flags (such as O_CREAT)

Thanks


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

Date: Wed, 10 May 2000 08:53:08 -0400
From: "BobS" <sturdevr@yahoo.com>
Subject: Re: perl in NT .BAT files Question
Message-Id: <8fbm37$d15$1@bob.news.rcn.net>

Hi,
Thanks, Philipe. I've looked at your module and appreciate your willingness
to share. I'm going to save this for future reference. I've been able to mod
my apps to produce executables that do the C-ISAM handling that is needed.
My problem now is to integrate the whole ((16/32-bit kludge ) with very
limited Perl experience. But I'm gaining ;-).

<philippe_cyk@my-deja.com> wrote in message
news:8f88d5$44e$1@nnrp1.deja.com...
> Hi,
>
> I have just uploaded a C-ISAM module on my website
> Follow the link :
>
> http:://www.oceanes.fr/~database/isampm.htm
>
> Please mail me a bug report at philippe.cyk@wanadoo.fr
>
> Hope this helps
>
>
> In article <8erpfb$3lp$1@bob.news.rcn.net>,
>   "BobS" <sturdevr@yahoo.com> wrote:
> > I hate to disappoint those with long faces. If I knew enough about
> Perl to
> > write a C-ISAM module (or any other module), _I_ would cheer and
> applaud in
> > the streets. Maybe later ;-)
> >
> > Bob
> >
> > "Jonathan Stowe" <gellyfish@gellyfish.com> wrote in message
> > news:8eppla$sv3$1@orpheus.gellyfish.com...
> > > On Tue, 2 May 2000 13:34:52 -0400 BobS wrote:
> > > > Thanks for the heads up. I'll keep that in mind. Since the
> proprietary
> > > > C-ISAM library does file access, my thought is to let Perl control
> the
> > file
> > > > handler routines already in place. Hmmm, I wonder if Perl has a
> C-ISAM
> > > > module ...
> > > >
> > >
> > > I dont think there is though If you were to write a DBI/DBD
> interface to
> > > the C-ISAM system you are using and submit it to CPAN I am sure
> there
> > > would be cheering and applause in the streets ;-}
> > >
> > > /J\
> > > --
> > > We'll die together, like a father and son should.
> > > --
> > > fortune oscar homer
> >
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Wed, 10 May 2000 10:24:54 GMT
From: ra jones <ra_jones@my-deja.com>
Subject: Re: Please check my 'random' code
Message-Id: <8fbddb$kcg$1@nnrp1.deja.com>



> It will tell you not to call srand:
>
>   In fact, it's usually not necessary to call srand at all, because if
>   it is not called explicitly, it is called implicitly at the first
>   use  of the rand operator. However, this was not the case in version
>   of Perl before 5.004, so if your script will run under older Perl
>   versions, it should call srand.
>
> To simulate a coin toss, the rand() function is quite adequate, and
> your approach is OK.  It can be compressed thus:
>
>     (qw(Test Control))[rand 2]
>

OK, thanks for that. Is there any harm in calling srand, even though the
script is running on 5.005? And are there any advantages (apart from
cosmetic) in compressing the code as you suggest?

--
ra jones (posted via deja.com)

address for e-mail reply:
rajones(at)mail.com


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 10 May 2000 10:35:12 GMT
From: ra jones <ra_jones@my-deja.com>
Subject: Re: Please check my 'random' code
Message-Id: <8fbe0v$l0t$1@nnrp1.deja.com>

In article <39173C60.EA6A3736@walgreens.com>,
  "Andrew N. McGuire" <andrew.mcguire@walgreens.com> wrote:

> Are you running under 'use strict' and '-w'? If not, it is a good
> idea.
No. Will it affect the result of my random allocation code?

> Do a 'perldoc -f srand', you could pick a better random seed here.
Could you suggest one? Perldoc suggests I don't need to call srand at
all.

> It is good practice to use diagnostics, such as:
>
>     open FILE, ">>$log" or die "Can't append to $log: $!\n";
Noted.

> > --
>
> That should be '-- ', or two dashes followed by a space.
>
> Cheers,
It was - at least on my system ;-)

--
ra jones (posted via deja.com)

address for e-mail reply:
ra(dot)jones(at)cwcom(dot)net


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 10 May 2000 10:00:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Printing Arrays
Message-Id: <391e30ec.9052518@news.skynet.be>

Ilja wrote:

>$, = "\n";
>print @block;

On too few newlines.

  $\ = "\n";
  print foreach @block;

-- 
	Bart.


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

Date: Wed, 10 May 2000 10:09:02 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Printing Arrays
Message-Id: <8fbcfo$jlt$1@nnrp1.deja.com>

In article <MPG.1381e7a7b5fe36fe98aa2a@nntp.hpl.hp.com>,
  Larry Rosler <lr@hpl.hp.com> wrote:
> In article <8f8lag$i4a$1@nnrp1.deja.com> on Tue, 09 May 2000 09:21:30
> GMT, Ilja <billy@arnis-bsl.com> says...
>
> ...
>
> > Hm-m, why you need loop to print an array ?
> >
> > $, = "\n";
> > print @block;
>
> To produce the same output as the other attempts, that should be:
>
>   print @block, "\n";

IMHO you'll get an extra new-line, I guess you mean:

print @block, "";

>
> And $, should be localized.
>
> Yet another way:
>
>   { local $" = "\n"; print "@block\n" }
>

Of course.

> That might be less efficient, though, because an implicit join() is
> performed before calling print().
>

Hm-m, maybe I really should re-consider ...
Thanx.
Ilja.




Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 10 May 2000 11:42:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Puzzle: DESTROY not destroying
Message-Id: <39234a81.15601885@news.skynet.be>

geoff_gunner@my-deja.com wrote:

>I had a module with a DESTROY method. That method was NOT getting
>called when the object was destroyed, even on script shutdown (wierd,
>huh?).

>3: A factory method stopped keeping a second 'my' reference to the
>object

That could be it. Is this a file scoped lexical variable? Could it still
keep a copy of the object reference when you release all external
references, and when *you* think it should be destroyed? Then, it won't
happen. Not until all references are removed.

Why it still won't happen when the script ends, I find a bit puzzling.

-- 
	Bart.


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

Date: Tue, 9 May 2000 22:56:23 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regular expression: how do I accept +integers or +floats only?
Message-Id: <slrn8hhjun.hmi.tadmc@magna.metronet.com>

On Tue, 9 May 2000 17:24:06 -0700, Ed Toivanen <et@telus.net> wrote:

>I'm trying to accept only positive numbers, 
 ^^^^^^^^^^                         ^^^^^^

But you are not trying very hard...


>that look like either integers
                       ^^^^^^^
>or floats. When I say "look like", I mean 1 or 1.1 or .1, not in reference
    ^^^^^
>to any particular data type.


   perldoc -q number

   perldoc -q integer

   perldoc -q float


A search of the Perl FAQ (which you were supposed to do *before*
posting to the Perl newsgroup) for any of those terms that
you used would have led to:

   "How do I determine whether a scalar is a number/whole/integer/float?"

Wherein there are a bunch of different regexes.


>This is my regular expression so far.
>  if( $days[$i]  =~ /\d+\.{0,1}\d{0,1}/){   #makes any non-digit = 0 except
                           ^^^^^  ^^^^^

You are typing 5 characters where one will do.

      /\d+\.?\d?/

? means "zero or one" (i.e. "optional")



>The problem is that while this thing does filter out 'abc' it does not
>filter out 't9.0'. As you can see, I am trying to accept one or more digits,
>0 or 1 decimal point, and 0 or 1 digit after the decimal.
>
>How can I make this thing work?


You need to anchor both ends of your pattern and account for
every allowable character.

See what the '^' and '$' characters do in regexes near the top of:

   perldoc perlre




Please visit    news.announce.newusers      too.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 10 May 2000 09:56:23 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: Socket Question-
Message-Id: <391931e5.96262121@news.dtu.dk>

On Tue, 09 May 2000 02:24:51 GMT, "Veronica Adams"
<adams1015@worldnet.att.net> wrote:

>Hey,
>
>I'm trying to build a client-server app for fun and I've run into a problem
>with some code I pulled off of www.perl.com

For Socket programming on Windows and Unix alike use the Modules
IO::Socket and IO::Select and the documentation therein. Avoid the use
of fork on Windows even if you have the latest version of Perl.
Signals don't even exist on Windows.

  Lars

 ------------------------------
Lars Gregersen (lg@kt.dtu.dk)
http://www.gbar.dtu.dk/~matlg

Check out the Perl search utility findgrep at:
http://members.xoom.com/gregersenweb/


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

Date: Wed, 10 May 2000 10:29:04 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: sort a two-dimensional array....
Message-Id: <8fbdl2$ksj$1@nnrp1.deja.com>

In article <391925EC.840AA07F@Siemens.ch>,
  Thomas.Wolfensberger@siemens.ch wrote:
> I need to sorrt a two-dimensional array.
> How can i do it?
>
> greez!
> wolfi...
>

Because you question is very hm-m... generic, so will be the answer:

1. Use sort function ('perldoc -f sort' for details).

2. perldoc perlfaq4 contains the FAQ: "How do I sort an array by (anything)?"
Also available from, say,
http://www.cpan.org/doc/manual/html/pod/perlfaq4.html

3. Also about sorting: http://www.perl.com/CPAN-local/doc/FMTEYEWTK/sort.html

Hope it helps.

Ilja.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 10 May 2000 12:58:20 GMT
From: "David Guiney" <david.guiney@detini.gov.uk>
Subject: Re: Strange Characters from Perl Script
Message-Id: <M1dS4.2$wy3.1188@newreader.ukcore.bt.net>

Thanks very much for your reply. Your solution worked well and the tip for
creating the form and parsing it within one script will be useful in the
future.

Since I recently started writing in perl I have collected a variety of read
and parse routines. I hadn't actually went through all of them in fine
detail to see what was going on, so when the script worked in Windows but
not unix I didn't suspect a problem here. Some of the other routines which I
have used in the past work also. I will not take any code on trust again!

Thanks again,

David

"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:3918CB7C.32242B3F@stomp.stomp.tokyo...

> "Godzilla!" wrote:
>
> > David Guiney wrote:
>
> David, I forgot to include a print
> for your html header. Doesn't make
> much of a difference. Would you add
> this code as shown, right up top,
> right after this line:
>
> print "Content-Type: text/html\n\n";
>
> Add this:
>
> print "
>   <HTML><HEAD><TITLE>David Test</TITLE></HEAD><BODY>";
>
>
> &Parse (reference so you will know where this fits in)
>
>
> Sorry for forgetting to add this in.
> I hope no problems resulted.
>
>
> Godzilla!




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

Date: Wed, 10 May 2000 12:08:55 GMT
From: vlad55@my-deja.com
Subject: URGENT HELP WITH REGEXP REQUIRED
Message-Id: <8fbjgc$r1e$1@nnrp1.deja.com>

I have a question,

I am trying to replace a text containing different chars by another
text block, problem is
my $newhtml =~ s/<!--[\n\t\r\ ]+VMySQLQueryParser$oldfunc\-->$old<!--
[\n\t\r\ ]+END[\n\t\r\ ]+-->/<!-- VMySQLQueryP ... .../gs;

treats the $oldfunc as a search pattern instead of static text, so if
the $func (or $old) contains chars like [,],(,),* etc.. it tries to
match them...

is there a quick workaround this?

I APPRICIATE YOUR HELP.

Vlad
vlad@email.com


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 10 May 2000 12:23:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: URGENT HELP WITH REGEXP REQUIRED
Message-Id: <39195477.18151064@news.skynet.be>

vlad55@my-deja.com wrote:

>my $newhtml =~ s/<!--[\n\t\r\ ]+VMySQLQueryParser$oldfunc\-->$old<!--
>[\n\t\r\ ]+END[\n\t\r\ ]+-->/<!-- VMySQLQueryP ... .../gs;

>treats the $oldfunc as a search pattern instead of static text, so if
>the $func (or $old) contains chars like [,],(,),* etc.. it tries to
>match them...
>
>is there a quick workaround this?

In the pattern, repalce "$oldfunc" with

	\Q$oldfunc\E

And please don't shout.

-- 
	Bart.


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

Date: Wed, 10 May 2000 12:37:41 GMT
From: "Stuart" <stuart.tavener@greenwichnatwest.com>
Subject: Win32 SYSTEM window
Message-Id: <391966e7.0@news2.cluster1.telinco.net>

Is there anyway of running a perl script or exe, as a quiet process in the
background, so i dont get that annoying black ms-dos system window appearing
?

Stuart.




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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 3002
**************************************


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