[24360] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6549 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 10 18:05:46 2004

Date: Mon, 10 May 2004 15:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 10 May 2004     Volume: 10 Number: 6549

Today's topics:
    Re: Conditional Statement failure  --- if ($a>0) <andre.wisniewski@gmx.de>
    Re: Conditional Statement failure  --- if ($a>0) (Jim Keenan)
    Re: Confused Newbie question: Decimal to IP <tadmc@augustmail.com>
    Re: Permission denied with PERL/APACHE (Nicolas D)
    Re: Please Recommend A Good Perl Book. <dwall@fastmail.fm>
    Re: Printing Array's content with carriage return (\n) <perl@my-header.org>
    Re: Very urgent: plz someone answer <jtc@shell.dimensional.com>
        www/javascript automation? <dkoleary@olearycomputers.com>
    Re: www/javascript automation? (Malcolm Dew-Jones)
    Re: www/javascript automation? <segraves_f13@mindspring.com>
    Re: www/javascript automation? <usenet@morrow.me.uk>
    Re: www/javascript automation? <tadmc@augustmail.com>
    Re: WWW::Search::Ebay <mark.clements@kcl.ac.uk>
    Re: WWW::Search::Ebay <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 10 May 2004 20:09:50 +0200
From: "Andre Wisniewski" <andre.wisniewski@gmx.de>
Subject: Re: Conditional Statement failure  --- if ($a>0)
Message-Id: <opr7sp2om7udlqzq@ares>

On Mon, 10 May 2004 21:01:37 -0000, Edward Wijaya <ewijaya@singnet.com.sg>  
wrote:

>
> #----My code snippet-----
> $a = countArray(@b);
> print "$a\n";        #----- line 325

Write
$count = @array;
and everything will be fine ...


-- 
Andre

--- Using Opera


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

Date: 10 May 2004 12:26:21 -0700
From: jkeen_via_google@yahoo.com (Jim Keenan)
Subject: Re: Conditional Statement failure  --- if ($a>0)
Message-Id: <196cb7af.0405101126.6f02dd73@posting.google.com>

Edward Wijaya <ewijaya@singnet.com.sg> wrote in message news:<opr7s1a1ceuj0cst@news.singnet.com.sg>...
> Sorry for my "misbehavior" guys.
> 
> BTW, I am not using $a under strict,
> even if I declare $a=0 beforehand
> it still gives the same error.
> 

For more on why you shouldn't use $a and $b as user-defined variables:
  perldoc -f sort

jimk


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

Date: Mon, 10 May 2004 15:54:28 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Confused Newbie question: Decimal to IP
Message-Id: <slrnc9vr04.271.tadmc@magna.augustmail.com>

Monica Roman <monicaroman@yahoo.com> wrote:

> I've read a lot of the threads on this conversion but could not figure
> out which one is the correct function.


Have you tried the Perl FAQ?


> I have never written PERL before, 


There is no PERL, there is only Perl and perl.


> Can someone help the translate into PERL the following SQL function?


Yes. _You_ can.

If you run into trouble post what you have so far and we will
help you fix it.


>          t:= ip / 256;
>          w:= 256 * (t - FLOOR(t));


The assignment, division, multiplication and subtraction operators are
documented in:

   perldoc perlop


The floor() function is a Question that is Asked Frequently:

   perldoc -q floor

       Does Perl have a round() function?  What about ceil() and floor()?
       Trig functions?


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


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

Date: 10 May 2004 14:07:27 -0700
From: nico99@netcourrier.com (Nicolas D)
Subject: Re: Permission denied with PERL/APACHE
Message-Id: <7fe6c964.0405101307.4813fbdf@posting.google.com>

Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrnc9tbgm.u7l.tadmc@magna.augustmail.com>...
> Nicolas D <nico99@netcourrier.com> wrote:
> 
> 
> > I use a PERLscript lauched by Apache web server,
> 
> 
> What is a "PERLscript"?
> 
> Did you mean "Perl script" or "Perlscript"instead?
> 
> 
> > with the line
> > "open (FICH, '>>commandes.txt') || die " error: :$!";
> > 
> > i obtain the following line in my  error.log:
> > "permission denied
> > 
> > i tried to change the rights but with no results.
> > 
> > what is the pb ?
>               ^^
>               ^^
> 
> What is the Peanut Butter? Your question makes no sense to me...
> 
> 
> Your problem is that you do not have the required permissions, what else?
> 
> You don't tell us what OS you are using, but if it is a *nix-flavor
> one, you may need to change the permisssions on the directory that
> the file is in, rather than the permissions on the file itself...

my OS is mandrake10 with "Apache-AdvancedExtranetServer/2.0.48
(Mandrake Linux/5mdk) mod_perl/1.99_11 Perl/v5.8.3 Server at 127.0.0.1
Port 80"

i write 
"User apache
Group apache" in httpd2.conf, 

the perl script is ok when i excecute it in the directory, i can write
in the file, but when i launch it with apache i obtain "permission
denied" when the script open the file with write access rights,
i create a login with apache user and apache group but no results,
i think my problem is that i don't know how configure apache to have
write rights....so i download the perl and apache documentation and i
ll read it.
Excuse for my english wich is as bad as my perl knowledge.


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

Date: Mon, 10 May 2004 18:27:54 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Please Recommend A Good Perl Book.
Message-Id: <Xns94E593254E53Bdkwwashere@216.168.3.30>

Mark Jason Dominus <mjd@plover.com> wrote:

> In article <u8yg41vbc.fsf@notvalid.se>,  <moller@notvalid.se>
> wrote: 
>>$persons {'Mark Jason Dominus'}{ nice } = 1;
> 
> I am afraid that is not really the case.  I think you may be
> confusing this with
> 
>         $persons {'Mark Jason Dominus'}{ good } = 1;
> 
> From a long way away, they can sometimes look similar.

OK, so you're a real rat-bastard, but you're *good* at it.



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

Date: Mon, 10 May 2004 22:09:02 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: Printing Array's content with carriage return (\n)
Message-Id: <h2ov90p8u0tkgs0q04q2j143ehn94i9km4@4ax.com>

X-Ftn-To: David Efflandt 

efflandt@xnet.com (David Efflandt) wrote:
>> Namely, it print out in vertical forms.
>
>If you want to print like that, but NOT insert newlines in your data, it
>may be better to simply:
>
>foreach (@myarray) { print "$_\n"; }

Second that, I would only drop braces and use modifier,

print "$_\n" for @myarray;



-- 
Matija


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

Date: 10 May 2004 12:20:02 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Very urgent: plz someone answer
Message-Id: <slrnc9vhuk.8s6.jtc@shell.dimensional.com>

In article <slrnc9uu4b.lc.tadmc@magna.augustmail.com>, Tad McClellan wrote:
> Neo <me4uwithluv@yahoo.com> wrote:
> 
>> Subject: Very urgent: plz someone answer
> 
> 
> [ tip: Putting "urgent" in your Subject ensures _less_ people will read it.
> 
>        Pleading in your Subject ensures _less_ people will read it.
> 
>        Please do not use "cutsie" spelling, it is inconsiderate of
>        those whose first language is not English.

and of those whose first language _is_ English.

> 
>   Have you seen the Posting Guidelines that are posted here frequently?
> 
> ]

Additionally, a subject should give an indication of what the post is
about, similar to a heading in a document.  For example, which would you
rather read - a book with a section on dinosaurs with the heading:

  "This is Important"

or the heading:

  "A Brief History of Dinosaurs"

A subject that has little to do with the posted topic, such as "Very
urgent: plz someone answer", will tend to elicit very few or no responses
addressing the problem.  It's also inconsiderate and counterproductive,
because it wastes the time of people who otherwise might help you.

By the way, the above advice can be applied to any document with a subject
line, such as an email message or a letter.

-- 
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]


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

Date: Mon, 10 May 2004 18:19:01 GMT
From: Doug O'Leary <dkoleary@olearycomputers.com>
Subject: www/javascript automation?
Message-Id: <pIPnc.82$Q45.9@fe07.usenetserver.com>

Hey, all;

Here's the situation:  I'm at a client that uses a web based trouble
ticket system that, for the most part, is pretty reasonable.  My
main issue with it is it tends to be slow and has a bunch of useless
eye-candy.  To get to the tickets I'm interested in, I have to click
something like 15 times.  What I was hoping to do was write a perl/lwp
script that will allow me to view the TTs from the command line and,
eventually, update and/or close them from the command line.

Unfortunately, after wrestling with the web pages for most of the 
morning, I realize that with very limited exceptions, they're all
dynamically generated via javascript.  

What I'm thinking *should* be possible is writing a script which 
will call the java functions directly.  That's much easier said
than done since I know absolutely nothing about javascript - yet -
however, I'd like to get confirmation that what I'm thinking about
is possible using one of the javascript modules on cpan.

Am I on the rigth track or is there an easier approach to what I'd
like to get done?

Thanks for any hints/tips/suggestions.

Doug O'Leary


-- 
--------
Senior UNIX Admin
O'Leary Computer Enterprises
dkoleary@olearycomputers.com (w) 630-904-6098 (c) 630-248-2749
resume:  http://www.olearycomputers.com/resume.html



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

Date: 10 May 2004 11:48:02 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: www/javascript automation?
Message-Id: <409fce62@news.victoria.tc.ca>

Doug O'Leary (dkoleary@olearycomputers.com) wrote:
: Hey, all;

: Here's the situation:  I'm at a client that uses a web based trouble
: ticket system that, for the most part, is pretty reasonable.  My
: main issue with it is it tends to be slow and has a bunch of useless
: eye-candy.  To get to the tickets I'm interested in, I have to click
: something like 15 times.  What I was hoping to do was write a perl/lwp
: script that will allow me to view the TTs from the command line and,
: eventually, update and/or close them from the command line.

: Unfortunately, after wrestling with the web pages for most of the 
: morning, I realize that with very limited exceptions, they're all
: dynamically generated via javascript.  

: What I'm thinking *should* be possible is writing a script which 
: will call the java functions directly.  That's much easier said
: than done since I know absolutely nothing about javascript - yet -
: however, I'd like to get confirmation that what I'm thinking about
: is possible using one of the javascript modules on cpan.

: Am I on the rigth track or is there an easier approach to what I'd
: like to get done?

Well there is a javascript module that can allow your perl program to run
javascript, and so in theory you could run the javascript from within perl
to generate the html (which the perl program would then parse to determine
that to do).  The problem I understand is that the javascript generating
the html will almost certainly be making use of the DOM environment of the
browser, but no one has built the code to emulate that, so unless the
javascript is simply a series of "write('text')" statements, then it isn't
practical to do this.

Is there no way to figure out what html gets generated, and thereby figure
out that it passes back to the server? 

Perhaps install a proxy temporarily on your PC, and monitor the requests
sent back to the server.  All you really want is to send similar requests
with new data.



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

Date: Mon, 10 May 2004 19:10:42 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: www/javascript automation?
Message-Id: <SsQnc.5205$KE6.3879@newsread3.news.atl.earthlink.net>

"Doug O'Leary" <dkoleary@olearycomputers.com> wrote in message
news:pIPnc.82$Q45.9@fe07.usenetserver.com...
> Hey, all;
>
> Here's the situation:  I'm at a client that uses a web based trouble
> ticket system that, for the most part, is pretty reasonable.  My
> main issue with it is it tends to be slow and has a bunch of useless
> eye-candy.  To get to the tickets I'm interested in, I have to click
> something like 15 times.  What I was hoping to do was write a perl/lwp
> script that will allow me to view the TTs from the command line and,
> eventually, update and/or close them from the command line.
>

IMO, Randal L. Schwartz' article "Web Techniques Column 43 (Nov 1999)"
should be helpful to you.

http://www.stonehenge.com/merlyn/WebTechniques/col43.html

The "Column 43" script can "invoke a URL, study the resulting HTML, and come
up with another Perl program that invokes the resulting form action script"

Many thanks to Randal!

Cheers.
--
Bill Segraves




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

Date: Mon, 10 May 2004 19:20:46 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: www/javascript automation?
Message-Id: <c7okme$p08$1@wisteria.csv.warwick.ac.uk>


Quoth Doug O'Leary <dkoleary@olearycomputers.com>:
> What I was hoping to do was write a perl/lwp
> script that will allow me to view the TTs from the command line and,
> eventually, update and/or close them from the command line.
> 
> Unfortunately, after wrestling with the web pages for most of the 
> morning, I realize that with very limited exceptions, they're all
> dynamically generated via javascript.  
> 
> What I'm thinking *should* be possible is writing a script which 
> will call the java

java ne javascript

> functions directly.  That's much easier said
> than done since I know absolutely nothing about javascript - yet -
> however, I'd like to get confirmation that what I'm thinking about
> is possible using one of the javascript modules on cpan.

This is almost certainly impossible: AFAIK, there isn't yet an
implementation of a JavaScript-able browser with a full DOM in Perl. You
could try writing one (it shouldn't be *that* hard...) but I doubt you
want to waste time on that just now... :)

A better idea would be to look at what the js does to the document, and
then write code to do that in Perl. This means, of course, being able to
read and comprehend the js yourself: it's not that difficult.

It will likely turn out that you can actually ignore most of the code:
for instance, I recently wrote a little script to do a similar thing for
the odeon.co.uk website, which is a festering mass of IE-specific js,
and it turned out that all I needed to do was grab the definition of one
variable and parse that... YMMV in this case, of course.

And, of course, if someone changes the backend so that it generates
slightly different javascript, you'll have to do it all over again... :)

Ben

-- 
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
  ben@morrow.me.uk                                                 (Kate Rusby)


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

Date: Mon, 10 May 2004 15:49:49 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: www/javascript automation?
Message-Id: <slrnc9vqnd.271.tadmc@magna.augustmail.com>

Doug O'Leary <dkoleary@olearycomputers.com> wrote:


> Unfortunately, after wrestling with the web pages for most of the 
> morning, I realize that with very limited exceptions, they're all
> dynamically generated via javascript.  
> 
> What I'm thinking *should* be possible is writing a script which 
> will call the java functions directly.  That's much easier said
> than done since I know absolutely nothing about javascript - yet -
> however, I'd like to get confirmation that what I'm thinking about
> is possible using one of the javascript modules on cpan.
> 
> Am I on the rigth track or is there an easier approach to what I'd
> like to get done?


You don't need the HTML. 

You don't need the JavaScript (javascript is not java).

You need to know what HTTP request is being generated...


> Thanks for any hints/tips/suggestions.


 ... http://www.research.att.com/~hpk/wsp/


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


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

Date: Mon, 10 May 2004 19:58:10 +0100
From: Mark Clements <mark.clements@kcl.ac.uk>
Subject: Re: WWW::Search::Ebay
Message-Id: <409fd0c2$1@news.kcl.ac.uk>

Marcus Reiter wrote:
> Hi,
> 
> is the modul WWW::Search:Ebay working under ActiveState Perl on Win XP?
> 
> I become no Results with it!
what exactly have you tried? A (smallish) script example would be useful.

Mark


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

Date: Mon, 10 May 2004 22:18:42 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: WWW::Search::Ebay
Message-Id: <i5ov90tf3b6i4sq81u145u2vtf0hp27t97@4ax.com>

On Mon, 10 May 2004 12:57:03 +0200, "Marcus Reiter"
<marcus.reiter@gmx.de> wrote:

>is the modul WWW::Search:Ebay working under ActiveState Perl on Win XP?
>
>I become no Results with it!

I'm not familiar with that module, but I'm quite confident that I
wouldn't become much Results with it too! ;-)

[Not a native english speaker myself, so don't become angry with me:
it's just a joke!]


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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