[22307] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4528 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 7 09:40:30 2003

Date: Fri, 7 Feb 2003 06:07:20 -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           Fri, 7 Feb 2003     Volume: 10 Number: 4528

Today's topics:
        ActivePerl distro. whatNext <samj@austarmetro.com.au>
    Re: ActivePerl distro. whatNext <spam@thecouch.homeip.net>
    Re: ActivePerl distro. whatNext (Helgi Briem)
    Re: ActivePerl distro. whatNext (Tad McClellan)
    Re: Crossposting (was: Fetchrow Question) (Anno Siegel)
    Re: Decoding Newsgroup Messages with Attachments <bernie@fantasyfarm.com>
    Re: Font lock problems in xemacs 20.0 in perl-mode <shanem@nospam.ll.mit.edu>
    Re: I'm just not getting it... FAQ5 (rab)
    Re: I'm just not getting it... FAQ5 (rab)
    Re: I'm just not getting it... FAQ5 (rab)
    Re: Need a bit of help with LWP <mgjv@tradingpost.com.au>
        p_cc.pl <member22301@dbforums.com>
        Perl based web testing (aXe!)
    Re: Perl based web testing <goldbb2@earthlink.net>
    Re: Perl Template <ubl@schaffhausen.de>
        Question on back-quotes (Kalyan)
    Re: Question on back-quotes <mr@sandman.net>
    Re: Question on back-quotes <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: Question on back-quotes <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: Question on back-quotes <mr@sandman.net>
    Re: Question on back-quotes <bernard.el-hagin@DODGE_THISlido-tech.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 05 Feb 2003 21:37:31 GMT
From: "Sam Jesse" <samj@austarmetro.com.au>
Subject: ActivePerl distro. whatNext
Message-Id: <3e418416@news.comindico.com.au>

Hello
I am new to Perl, coming from windows 2000 and my mind set up is all
windows. I downloaded a zip file named Stable from Perl.com unziped it to a
folder named Perl-5.8.0, then I went looking for *.exe file to install the
program but found nothing. well.. am I missing something? then I learnd oh..
there is a source code and there is bianary.. well what does that suppose to
mean.. no clue.. oh.. I remember I downloaded the source code.. well maybe
if I download a bianary that will have *.exe to install the program. so I
happen to go to ActivePerl5.8 downloaded that and now I have *.exe.. oh
great.. letus install it .. then ... your Windows Installer is not the
latest version. Ok.. got that fiexed and installed the program.. great..
State | Programs | ActievePerl | Pakage Manager which opend a ppm> prompt..
what I am suppoe to do.. where I am going with this.. the documnetations
under ActivePerl looks nice and colorfull not no good tutourial on where to
go from here.. any body can tell me what's going on and maybe some good
sites for my problems.
is there more than one distro of perl,, which is the best.. is there a
compair site for all of them.. that sort of thing
thanks
Sam




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

Date: Fri, 07 Feb 2003 02:27:45 -0500
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: ActivePerl distro. whatNext
Message-Id: <NdJ0a.19202$YH4.96766@wagner.videotron.net>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

samphdauto wrote:
|>| then I learnd oh..
|>| there is a source code and there is bianary.. well what does that
|> suppose to
|>| mean.. no clue.. oh..
|>
|>If you do not know the difference then I suggest you invest in a book
|>tailored to beginner programmers in general.
|
|
| any recommendation for this, and for Perl in specific? and oh.. is
| there a Perl newsgroup that is very fast in responds, google takes too
| long just to post original posts.?

Nope, sorry.  Maybe others can assist with this one.

|
|
|>|I remember I downloaded the source code.. well maybe
|>| if I download a bianary that will have *.exe to install the program.
so I
|>| happen to go to ActivePerl5.8 downloaded that and now I have *.exe.. oh
|>| great.. letus install it .. then ... your Windows Installer is not the
|>| latest version. Ok.. got that fiexed and installed the program.. great..
|>| State | Programs | ActievePerl | Pakage Manager which opend a ppm>
|>prompt..
|>
|>Package Manager is used to install additional packages/modules.  Is that
|>what you want ? then type "help" at the ppm> prompt. If that's not what
|>you want, then do not run the Package Manager.
|
|
| so the packages is programs written to be executed by perl.ext. is do
| you recommend some sites which has some free & usfull downloads
| instead of writing my own from scratch?

Take a look at http://search.cpan.org . These are all modules written by
others that you can use in your own program to avoid re-inventing the
wheel and concentrate on the task-at-hand.


| I will need to run packges as well as write my own. now to run
| packages, I did like nobody suggested perl -e "print 'Hello World!'"
| which printed Hello World!

Great. That's called a 1-liner which you just ran successfully.

| .. now.. to run a package, would I do the
| same sort of thing? I know this perl myscriptfile.pl will run a file.
| is it the same for a package?

No. At this point I'll ask you to stop using the word "package" and use
"module" instead.

Usually you don't run perl modules directly, but you use() them inside a
main perl program and call their functions/methods to do things in your
own program.

| if activePerl is not a programming environment. how do I get a
| Porgramming enviro inodrer to start making my own packages?

I think activestate offers a programming environment (aside from just
the base perl installation which does not contain an environment).

There really is no "standard" perl IDE (Integrated Development
Environment).  Most programmers are happy using some sort of advanced
programmers editor.  Personally I use GVIM ( http://www.vim.org ).
However, any plaintext editor will work.  You can even use windows's
"notepad" to write your perl code.

Best of luck.


-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+Q1/xeS99pGMif6wRArdHAJ0S5a7d9vRx3KLqzqcnS4Yw50wiIQCgif2e
NfwsWmELmwHLTDmoWydl5w8=
=2d8G
-----END PGP SIGNATURE-----



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

Date: Fri, 07 Feb 2003 11:36:47 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: ActivePerl distro. whatNext
Message-Id: <3e43987d.760704004@news.cis.dfn.de>

On 6 Feb 2003 10:39:39 -0800, samj@eisa.net.au (samphdauto)
wrote:

>> If you do not know the difference then I suggest you invest in a book
>> tailored to beginner programmers in general.
>
>any recommendation for this, and for Perl in specific? 

Learn how to use the Perl documentation installed
on your own computer, probably in C:/Perl/html/index.html
and accessible from the command line using perldoc.

perldoc -q books

Also:
http://www.perldoc.com/perl5.8.0/pod/perlfaq2.html#Perl-Books


>and oh.. is there a Perl newsgroup that is very fast in responds, 

You're treading very close to a lot of killfiles here.
There are human beings responding to your posts,
not robots.  Show a little patience.

>google takes too long just to post original posts.?

Then use a real news client.  Google is an archive,
not a news server.  I suggest Forte Free Agent.

>so the packages is programs written to be executed by perl.ext. is do
>you recommend some sites which has some free & usfull downloads
>instead of writing my own from scratch?

You're going to have to make up your mind. Do you want
to learn to use Perl or not?  If not, this is the wrong 
place for you.  I suggest http://nms-cgi.sourceforge.net/ 
if free scripts are all you want.
-- 
Regards, Helgi Briem
helgi AT decode DOT is


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

Date: Fri, 7 Feb 2003 07:48:39 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: ActivePerl distro. whatNext
Message-Id: <slrnb47e9n.h54.tadmc@magna.augustmail.com>

samphdauto <samj@eisa.net.au> wrote:

> is
> there a Perl newsgroup that is very fast in responds, google takes too
> long just to post original posts.?


It seems that you do not really understand how Usenet works yet.

1) How long it takes to send posts is a function of your news
   provider, not a function of a particular newsgroup.
   (ie. the problem is using Google, the problem is not clpmisc)

Posts from my ISP are sent out every few minutes for example.
Change providers if you really need it to be better.


2) Newsgroups do not "respond". People respond.

You cannot rely on "fast" responses to newsgroup posts. In fact,
you cannot rely on _any_ responses. When someone is both interested
in your problem _and_ has time available, then they will respond.
You just have to wait and see if those two things happen to
coincide for anyone who reads your post.

If it is truly critical to get fast responses, you could hire
someone who will answer your questions in a timely manner.
That likely only makes sense in a business context, hobbyists
just have to take whatever they can get for free.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 7 Feb 2003 08:51:03 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <b1vs1n$87u$2@mamenchi.zrz.TU-Berlin.DE>

mgarrish <mgarrish@rogers.com> wrote in comp.lang.perl.misc:
> 
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnb40flh.8b8.tadmc@magna.augustmail.com...
> >
> > Pardon me, but your ignorance is showing.
> >
> 
> He's been pouting ever since he had trouble understanding a simple scoping
> problem I posed a long time back. I really enjoyed how you've all tried to
> pin this on me, though, without realizing any of the context. ...

Oh, a long-held grudge.  The "context" exists nowhere except in your
head.

[self-righteous blathering snipped]

Anno


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

Date: Fri, 07 Feb 2003 08:46:29 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Decoding Newsgroup Messages with Attachments
Message-Id: <119EA6F9099BDA09.2C68F1CA50BD26A8.CF48EA0AEB893A06@lp.airnews.net>

"Deke" <deke@shillelagh.org> wrote:

} The problem I'm running into is decoding messages with attachments.   I've
} never really played much with newgroups (beyond simple posting), but
} apparently files can either be attached using MIME format or by uuencoding.

Note that there is a third format that is becoming pretty popular:
yenc'oding.

} Questions:
} 1) Any suggestions on how I can recognize messages with files attached

MIME is relatively easy [at the least you can look for the 'boundary'
header on the message].  For the other two, the ONLY key, AFAIK, is to look
at the first line of the message.  If it is "begin ....." then the message
is uuencoded anbd if the first line of the message is 'ybegn ..." then the
message is yencoded.

} 2) How do I decode these messages

That's going to be a VERY hard problem and I recommend you not bother.  The
problem is that for all three, files can be, and generally are, sent out in
multiple parts and the various parts need to be located and concatenated
before you do any decoding.  Doing this requires some heavy mojo-magic on
the subject line, trying to guess whether some part of the subject line is
a "part n out of M" cue, and if so you need to find *all* the other parts
[and if even one is missing you can't decode the message]. Then you need to
download *all* the pieces, concatenate their bodies and THEN decode.

simple answer: don't bother..:o)

  /Bernie\

-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Wed, 05 Feb 2003 16:59:38 -0500
From: Shane McDaniel <shanem@nospam.ll.mit.edu>
Subject: Re: Font lock problems in xemacs 20.0 in perl-mode
Message-Id: <3E41894A.CF71589A@nospam.ll.mit.edu>



Daniel Chandran wrote:
> 
> I am using XEmacs v 20.0, and have a strange font
> lock problems in perl mode.
> 
> sub MySub
> {
> 
> }
> 
> does not font lock  the function name whereas
> 
> sub MySub {
> 
> }
> 
> does fine.  Is there any var I need to set for the first form
> to get syntax highlighting?
> 
> Thanks,
> daniel

This is not a problem with the Perl language but with Emacs support for
the Perl syntax, you need to ask in an emacs group, it is off topic
here.

-shane


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

Date: 7 Feb 2003 05:28:03 -0800
From: richardbriggs@att.com (rab)
Subject: Re: I'm just not getting it... FAQ5
Message-Id: <900b7105.0302070528.6a15d5f4@posting.google.com>

"John W. Krahn" <krahnj@acm.org> wrote in message news:<3E42F63B.F60D4A19@acm.org>...
> rab wrote:
> > > > I'm hitting a wall on how to match the pattern (grok-3.+) and delete
> > those lines containing it, while simultaneously replacing those lines
> > in that same place in the file with the new grok-3 modified single
> > line.
> 
> perl -i.bak -0777pe's/(^grok-3.*\n)+/grok-3 NEW TEXT HERE\n/m' yourfile
> 
> 
> John


John...thanks for the suggestion.   Since there were three lines
containing "grok-3" in the original file, the new line was inserted 3
times with this construct.   Any ideas how to delete all three of the
original lines while only replacing them with one line, one time?

Richard


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

Date: 7 Feb 2003 05:42:04 -0800
From: richardbriggs@att.com (rab)
Subject: Re: I'm just not getting it... FAQ5
Message-Id: <900b7105.0302070542.6c7c0040@posting.google.com>

"James E Keenan" <jkeen@concentric.net> wrote in message news:<b1urie$akk@dispatch.concentric.net>...> >
> If I understand your objective, the solution was even simpler than I
> thought:
> 
> use Tie::File;
> 
> my $file = 'grok.txt';
> 
> my @arr = ();
> tie @arr, 'Tie::File', $file or die "Could not tie $file: $!";
> for (my $i=0; $i<=$#arr; $i++) {
>         my $temp = $arr[$i];
>         $arr[$i] = 'grok-3 NEW TEXT HERE' if ($temp =~ /^grok-3/);
> }
> untie @arr;


James... thanks for your response...  I tried this block and it ran
fine, but did not seem to modify the original file.  I guess I need to
write $arr[$i] into the file some how?  Sorry for the density here,
I've never used Tie::File.  Please be patient.

Richard


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

Date: 7 Feb 2003 06:23:06 -0800
From: richardbriggs@att.com (rab)
Subject: Re: I'm just not getting it... FAQ5
Message-Id: <900b7105.0302070623.bba72e0@posting.google.com>

Jeff D Gleixner <glex_nospam@qwest.net> wrote in message news:<2oC0a.91$yr3.65618@news.uswest.net>...
> 
> open(D, "<datafile") or die "..";
> open(TMP, ">tmpfile") or die "..";
> my $found=0;
> my $new_data='some junk';
> while (<D>)
> {
> 	if (/^grok-3/)
> 	{
> 		if (!$found)
> 		{
> 			print TMP $new_data, "\n";
> 			$found++;
> 		}
>  next;
> 	}
>  print TMP;
> }
> close (TMP); close(D);
> rename ("./tmpfile", "./datfile") or die "...";

WOW! 

This worked great!   Thanks so much Jeff!  I wish I understood WHY it
worked!  I will keep studying it until I do.

"When in doubt...always follow your nose"  ~ Gandalf.

;-)


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

Date: Fri, 07 Feb 2003 05:35:36 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Need a bit of help with LWP
Message-Id: <slrnb46hd9.se5.mgjv@verbruggen.comdyn.com.au>

On Thu, 06 Feb 2003 22:43:44 -0600,
	Anthony Saffer <anthonysaffer@NOSPAM.yahoo.com> wrote:
> Hello Everyone,
> 
> My wife has asked me to write her a small script to help her keep
> track of several websites she manages. Basically, the script will be
> set on a cron job and will visit each page (url listed in a text
> file), go line by line through the page text, and use regular
> expressions to extract certain information from the page (url's
> mostly). Is there a way to search the page without having to download
> it with the getstore() method? How would you accomplish this goal?

Yes, there are many ways to search a "page" without using the
getstore() method (is this the LWP one?) but no portable ones that you
can use without downloading the data at all.

In other words: I am not entirely sure _what_ exactly you're trying to
avoid. I'll assume that you are talking about LWP::Simple::getstore,
and that you are trying to avoid storing the remote data on disk
before using it. If that isn't right, please be more specific.

The LWP modules have many other methods available to get remote data
over HTTP. The LWP::Simple module has several. I _think_ you're
looking for LWP::Simple::get(), but who knows?

Do try to read the documentation for LWP::Simple and the lwpcook
documentation. It's quite good.

Martien
-- 
                        | 
Martien Verbruggen      | Freudian slip: when you say one thing but
Trading Post Australia  | mean your mother.
                        | 


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

Date: Fri, 07 Feb 2003 03:43:39 +0000
From: pGG <member22301@dbforums.com>
Subject: p_cc.pl
Message-Id: <2495283.1044589419@dbforums.com>


###OS:          Windwos 2000 Professional
###Perl:        ActivePerl 5.8
###C compiler:  MS Visual C++ 6.0
###Location:    c:\pgg\
###download:    http://www.chinaperl.org/perlfans/pgg/download/p_cc.ple
###equal:       perl -e encode
____________________________________________________________________
c:\pGG\bin>type oldcc.pl
use MD5;
my $md=new MD5;
my $gh=MD5->hexhash("p_cc");
print $gh;
c:\pGG\bin>oldcc.pl
03742820f50fb5d9d5ab876d0231eb20
c:\pGG\bin>perlcc oldcc.pl
###Error!!!
____________________________________________________________________
###Now,try p_cc.pl.
c:\pGG\bin>p_cc.pl

c:\pGG\bin>type newcc.pl
eval eval '"'.


('['^'.').('['^'(').('`'|'%').('{'^'[').('`'^'-').('`'^'$').('^'^('`'|-
'+')).';'.
('!'^'+').('`'|'-').('['^'"').('{'^'[').'\\'.'$'.('`'|'-').('`'|'$').'-
='.('`'|'.
').('`'|'%').('['^',').('{'^'[').('`'^'-').('`'^'$').('^'^('`'|'+')).'-
;'.('!'^'+
').('`'|'-').('['^'"').('{'^'[').'\\'.'$'.('`'|"'").('`'|'(').'='.('`'-
^'-').('`'
^'$').('^'^('`'|'+')).'-'.'>'.('`'|'(').('`'|'%').('['^'#').('`'|'(').-
('`'|'!').
('['^'(').('`'|'(').'('.'\\'.'"'.('['^'+').'_'.('`'|'#').('`'|'#').'\\-
'.'"'.')'.
';'.('!'^'+').('['^'+').('['^')').('`'|')').('`'|'.').('['^'/').('{'^'-
[').'\\'.'
$'.('`'|"'").('`'|'(').';'.'"'
c:\pGG\bin>perlcc newcc.pl
pcccj8V3.c
pcccj8V3.c(346) : warning C4101: 'targ' : unreferenced local variable
pcccj8V3.c(1462) : warning C4101: 'targ' : unreferenced local variable

c:\pGG\bin>a.exe
03742820f50fb5d9d5ab876d0231eb20
c:\pGG\bin>
####################################################################
#                               p_cc.pl                            #
####################################################################
#!c:/pgg/bin/perl.exe -w
use strict;
#####  Name:      p_cc.pl
#####  Version:   0.0.1.0
#####  Author:    pGG
#####  Contact:   y6cme@sohu.com
#####  Licence:   The license of Perl
#####  Updated:   2003-2-3
my $one=shift||'oldcc.pl';
my $two=shift||'newcc.pl';
my @C=(
q Z('!'^'!')Z,q Z('('^')')Z,q Z('<'^'>')Z,q Z('>'^'=')Z,
q Z('>'^':')Z,q Z('>'^';')Z,q Z('+'^'-')Z,q Z('*'^'-')Z,
q Z('+'^'#')Z,q Z('*'^'#')Z,q Z('!'^'+')Z,q Z('!'^'*')Z,
q Z('!'^'-')Z,q Z('!'^',')Z,q Z('!'^'/')Z,q Z('!'^'.')Z,
q Z('?'^'/')Z,q Z('<'^'-')Z,q Z('-'^'?')Z,q Z('.'^'=')Z,
q Z('+'^'?')Z,q Z('*'^'?')Z,q Z('?'^')')Z,q Z('<'^'+')Z,
q Z('%'^'=')Z,q Z('&'^'?')Z,q Z('?'^'%')Z,q Z('>'^'%')Z,
q Z('&'^':')Z,q Z('<'^'!')Z,q Z('?'^'!')Z,q Z('%'^':')Z,
q Z('{'^'[')Z,q Z'!'Z,q Z'\\\\'.'"'Z,q Z'#'Z,
q Z'\\\\'.'$'Z,q Z'%'Z,q Z'&'Z,q Z"'"Z,q Z'('Z,q Z')'Z,
q Z'*'Z,q Z'+'Z,q Z','Z,q Z'-'Z,q Z'.'Z,q Z'/'Z,
q Z('^'^('`'|'.'))Z,q Z('^'^('`'|'/'))Z,q Z('^'^('`'|','))Z,
q Z('^'^('`'|'-'))Z,q Z('^'^('`'|'*'))Z,q Z('^'^('`'|'+'))Z,
q Z('^'^('`'|'('))Z,q Z('^'^('`'|')'))Z,q Z(':'&'=')Z,
q Z(';'&'=')Z,q Z':'Z,q Z';'Z,q Z'<'Z,q Z'='Z,q Z'>'Z,q Z'?'Z,
q Z'\\\\'.'@'Z,q Z('`'^'!')Z,q Z('`'^'"')Z,q Z('`'^'#')Z,
q Z('`'^'$')Z,q Z('`'^'%')Z,q Z('`'^'&')Z,q Z('`'^"'")Z,
q Z('`'^'(')Z,q Z('`'^')')Z,q Z('`'^'*')Z,q Z('`'^'+')Z,
q Z('`'^',')Z,q Z('`'^'-')Z,q Z('`'^'.')Z,q Z('`'^'/')Z,
q Z('{'^'+')Z,q Z('{'^'*')Z,q Z('{'^')')Z,q Z('{'^'(')Z,
q Z('{'^'/')Z,q Z('{'^'.')Z,q Z('{'^'-')Z,q Z('{'^',')Z,
q Z('{'^'#')Z,q Z('{'^'"')Z,q Z('{'^'!')Z,q Z'['Z,
q Z'\\\\'.'\\\\'Z,q Z']'Z,q Z'^'Z,q Z'_'Z,
q Z'`'Z,q Z('`'|'!')Z,q Z('`'|'"')Z,q Z('`'|'#')Z,
q Z('`'|'$')Z,q Z('`'|'%')Z,q Z('`'|'&')Z,q Z('`'|"'")Z,
q Z('`'|'(')Z,q Z('`'|')')Z,q Z('`'|'*')Z,q Z('`'|'+')Z,
q Z('`'|',')Z,q Z('`'|'-')Z,q Z('`'|'.')Z,q Z('`'|'/')Z,
q Z('['^'+')Z,q Z('['^'*')Z,q Z('['^')')Z,q Z('['^'(')Z,
q Z('['^'/')Z,q Z('['^'.')Z,q Z('['^'-')Z,q Z('['^',')Z,
q Z('['^'#')Z,q Z('['^'"')Z,q Z('['^'!')Z,q Z'\\\\'.'{'Z,
q Z'|'Z,q Z'\\\\'.'}'Z,q Z'~'Z,q Z('!'^'^')Z
);
push @C,map{join '.',q#'\\\\'#,$C[120],map($C[$_],unpack('C*',sprintf('-
%x',$_)))}128..255;
my @D=map{chr()}0..255;
my $gh="eval eval \'\"\'\.";
my $mm="\'\"\'";
my @cd;
for(0..255){
push(@cd,$D[$_],$C[$_]);
}
my %CD=@cd;
open(OLD,"$one") or die "$!";
open(NEW,">$two") or die "$!";
my @array;
while(<OLD>){
push(@array,$_);
}
my $vov=join("",@array);
my $len=length($vov);
print NEW "$gh\n\n\n";
for(0..$len-1){
my $str=substr($vov,$_,1);
print NEW "$CD{$str}\.";
}
print NEW $mm;
close OLD;
close NEW;
#enjoy it

--
pGG


Posted via http://dbforums.com


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

Date: 6 Feb 2003 21:34:25 -0800
From: axe_fx@yahoo.com (aXe!)
Subject: Perl based web testing
Message-Id: <d665de76.0302062134.40e9666c@posting.google.com>

Hi 

I am trying to write some perl code, here, to test my
web-applications. I am using Win32::OLE to create an Internet Explorer
instance and test the GUI on my web-pages. (I know there are modules
already available that do most of the stuff... but I want some module
that could assert java-script alerts also...)

There is this button on my page, that is supposed to display a
javascript alert upon clicking. I am accessing the button thru OLE and
am performing a click programmatically. I wish to assert that a
javascript alert is popped up when the button is clicked.

My problem is, that after I 'click' on the button, the code after the
click doesn't execute unless I respond to the alert manually (BTW a
javascript alert is a modal dialog). In order to respond to the alert
programmatically I need access to the alert dialog, the code for
which, again, comes after the code for click (and thats Y isn't
reachable by the current thread).

I am thinking, probably, I can spawn a worker thread that performs the
click and returns. The boss thread, in the meantime, can start looking
for ways to assert whether the alert is shown or not.

I am using Win32::OLE, Win32::GUITest and Win32::ActAcc to achieve
this. Please suggest/help me out. I will be obliged. If there is
already any module that can do this... please please please let me
know.

Thanks, 
aXe!


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

Date: Fri, 07 Feb 2003 01:10:13 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Perl based web testing
Message-Id: <3E434DC5.9F5A1D5F@earthlink.net>

"aXe!" wrote:
[snip]
> I am thinking, probably, I can spawn a worker thread that performs the
> click and returns. The boss thread, in the meantime, can start looking
> for ways to assert whether the alert is shown or not.

Spawn the worker thread before run your code which simulates a click on
the button.  The worker thread should wait for the alert to pop up, then
click on the popup's ok.  The boss thread, after spawning the worker,
does the click, then waits for the worker thread to finish.

To create the worker thread, use the fork() function (if on 5.6.1), or
the threads module (if on 5.8.0).

-- 
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
 landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"


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

Date: Fri, 07 Feb 2003 09:52:09 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Perl Template
Message-Id: <b1vvb8$mfb$1@news.dtag.de>

karmayogi wrote:
> Hi,
> 
>    I have a very simple question. This might be very easy for you Perl
> Wizards out there. How do I include a template say HTML:template in my
> perl program, and make sure that a particular version of the template
> say 2.3 is picked up. I ask this because the common repository has two
> versions of the HTML templates, and I want to make sure my program
> picks up the correct version.

Welcome to DLL Hell.

Some Answers:
use C#
use Perl 6

Since probably both won't be a possibility, you can might also be able 
to do this:

Do evil tricks with @INC
Include the version in the module name.

->malte



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

Date: 7 Feb 2003 05:39:58 -0800
From: kalyan120@yahoo.com (Kalyan)
Subject: Question on back-quotes
Message-Id: <75c5f32.0302070539.1276dd98@posting.google.com>

Hi All,
     in my script, I have to execute an external command from my
script. I'm running this script on WinNT. I have a file with the path:
d:/my dir/books.xml .
Please note that the directory is having a space in between. 

    Now, when I try to execute the command:

    $path = "\"d:/my dir/books.xml\"";
    @file = `dir $path`; #should be --> dir "d:/my dir/books.xml"

it says that, it is not able to find the file (but the file is present
in the directory). The back-quotes are not able to recognize the
double quotes around the path. The command is taken as: dir d:/my
dir/books.xml (note that the double quotes are not there around the
path).

    Is this a constraint? Can I achieve this with anyother command?
Can someone please help me asap.

Thanks,
Kalyan


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

Date: Fri, 07 Feb 2003 14:50:05 +0100
From: Sandman <mr@sandman.net>
Subject: Re: Question on back-quotes
Message-Id: <mr-985EDC.14500507022003@news.fu-berlin.de>

In article <75c5f32.0302070539.1276dd98@posting.google.com>,
 kalyan120@yahoo.com (Kalyan) wrote:

> Hi All,
>      in my script, I have to execute an external command from my
> script. I'm running this script on WinNT. I have a file with the path:
> d:/my dir/books.xml .
> Please note that the directory is having a space in between. 
> 
>     Now, when I try to execute the command:
> 
>     $path = "\"d:/my dir/books.xml\"";
>     @file = `dir $path`; #should be --> dir "d:/my dir/books.xml"
> 
> it says that, it is not able to find the file (but the file is present
> in the directory). The back-quotes are not able to recognize the
> double quotes around the path. The command is taken as: dir d:/my
> dir/books.xml (note that the double quotes are not there around the
> path).
> 
>     Is this a constraint? Can I achieve this with anyother command?
> Can someone please help me asap.

Isn't it supposed to be "d:\my dir\books.xml\" ?

-- 
Sandman[.net]


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

Date: Fri, 7 Feb 2003 13:50:41 +0000 (UTC)
From: "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Question on back-quotes
Message-Id: <Xns931B964F1BC15elhber1lidotechnet@62.89.127.66>

Kalyan wrote:

> Hi All,
>      in my script, I have to execute an external command from my
> script. I'm running this script on WinNT. I have a file with the path:
> d:/my dir/books.xml .
> Please note that the directory is having a space in between. 
> 
>     Now, when I try to execute the command:
> 
>     $path = "\"d:/my dir/books.xml\"";
>     @file = `dir $path`; #should be --> dir "d:/my dir/books.xml"


Try it this way:


$path = '"d:/my dir/books.xml"';
@file = `dir $path`;


-- 
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'



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

Date: Fri, 7 Feb 2003 13:51:30 +0000 (UTC)
From: "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Question on back-quotes
Message-Id: <Xns931B967221DD3elhber1lidotechnet@62.89.127.66>

Sandman wrote:

> In article <75c5f32.0302070539.1276dd98@posting.google.com>,
>  kalyan120@yahoo.com (Kalyan) wrote:
> 
>> Hi All,
>>      in my script, I have to execute an external command from my
>> script. I'm running this script on WinNT. I have a file with the path:
>> d:/my dir/books.xml .
>> Please note that the directory is having a space in between. 
>> 
>>     Now, when I try to execute the command:
>> 
>>     $path = "\"d:/my dir/books.xml\"";
>>     @file = `dir $path`; #should be --> dir "d:/my dir/books.xml"
>> 
>> it says that, it is not able to find the file (but the file is present
>> in the directory). The back-quotes are not able to recognize the
>> double quotes around the path. The command is taken as: dir d:/my
>> dir/books.xml (note that the double quotes are not there around the
>> path).
>> 
>>     Is this a constraint? Can I achieve this with anyother command?
>> Can someone please help me asap.
> 
> Isn't it supposed to be "d:\my dir\books.xml\" ?
 

Did you try that?


-- 
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'



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

Date: Fri, 07 Feb 2003 15:18:50 +0100
From: Sandman <mr@sandman.net>
Subject: Re: Question on back-quotes
Message-Id: <mr-6541D7.15185007022003@news.fu-berlin.de>

In article <Xns931B967221DD3elhber1lidotechnet@62.89.127.66>,
 "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:

> >> Hi All,
> >>      in my script, I have to execute an external command from my
> >> script. I'm running this script on WinNT. I have a file with the path:
> >> d:/my dir/books.xml .
> >> Please note that the directory is having a space in between. 
> >> 
> >>     Now, when I try to execute the command:
> >> 
> >>     $path = "\"d:/my dir/books.xml\"";
> >>     @file = `dir $path`; #should be --> dir "d:/my dir/books.xml"
> >> 
> >> it says that, it is not able to find the file (but the file is present
> >> in the directory). The back-quotes are not able to recognize the
> >> double quotes around the path. The command is taken as: dir d:/my
> >> dir/books.xml (note that the double quotes are not there around the
> >> path).
> >> 
> >>     Is this a constraint? Can I achieve this with anyother command?
> >> Can someone please help me asap.
> > 
> > Isn't it supposed to be "d:\my dir\books.xml\" ?
>  
> 
> Did you try that?

I'm not on a Windows system.

-- 
Sandman[.net]


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

Date: Fri, 7 Feb 2003 14:22:41 +0000 (UTC)
From: "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Question on back-quotes
Message-Id: <Xns931B9BBB633Aelhber1lidotechnet@62.89.127.66>

Sandman wrote:

> In article <Xns931B967221DD3elhber1lidotechnet@62.89.127.66>,
>  "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
> 
>> >> Hi All,
>> >>      in my script, I have to execute an external command from my
>> >> script. I'm running this script on WinNT. I have a file with the
>> >> path: d:/my dir/books.xml .
>> >> Please note that the directory is having a space in between. 
>> >> 
>> >>     Now, when I try to execute the command:
>> >> 
>> >>     $path = "\"d:/my dir/books.xml\"";
>> >>     @file = `dir $path`; #should be --> dir "d:/my dir/books.xml"
>> >> 
>> >> it says that, it is not able to find the file (but the file is
>> >> present in the directory). The back-quotes are not able to
>> >> recognize the double quotes around the path. The command is taken
>> >> as: dir d:/my dir/books.xml (note that the double quotes are not
>> >> there around the path).
>> >> 
>> >>     Is this a constraint? Can I achieve this with anyother
>> >>     command? 
>> >> Can someone please help me asap.
>> > 
>> > Isn't it supposed to be "d:\my dir\books.xml\" ?
>>  
>> Did you try that?
> 
> I'm not on a Windows system.


Try it on the system you're on. The result will be similar (ie. crap).


-- 
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'



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

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 4528
***************************************


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