[16607] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4019 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 15 06:05:36 2000

Date: Tue, 15 Aug 2000 03:05:16 -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: <966333916-v9-i4019@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 15 Aug 2000     Volume: 9 Number: 4019

Today's topics:
    Re: - Using run time value as arry names???? nobull@mail.com
    Re: Accessing ODBC data using PERL <gellyfish@gellyfish.com>
        ARRAY of HASH values <glodalec@yahoo.com>
    Re: Array Printing (Logan Shaw)
    Re: Ascii highlight code? (Villy Kruse)
    Re: Can't call a script from html created by another sc <gellyfish@gellyfish.com>
        Cookie refresh problem under netscape commmunicator <gold@kr8.com>
    Re: date and time in perl <lincolnmarr@europem01.nt.com>
    Re: dr watson <haggi@tappe.net>
    Re: dr watson (Anno Siegel)
    Re: force ascii file upload with cgi.pm <gellyfish@gellyfish.com>
    Re: Help a little needed from regex expert please <robert@chalmers.com.au>
    Re: How to execute perlscript from html site <gellyfish@gellyfish.com>
    Re: ignore IP address (Logan Shaw)
    Re: matching starting html code <gellyfish@gellyfish.com>
    Re: MS Word 2000 using Win32::OLE <gellyfish@gellyfish.com>
        need help with msql and perl <hello@hello.com>
    Re: Negativity in Newsgroup -- Solution (Tim Hammerquist)
    Re: Newbie post problem. <georgec@webleicester.co.uk>
    Re: Newbie post problem. <georgec@webleicester.co.uk>
    Re: Newbie post problem. <gellyfish@gellyfish.com>
    Re: Oracle connectivity using Perl <peter_gadsbyNOpeSPAM@hfcbank.co.uk.invalid>
    Re: Organizing and verifying a set of tree structures (Anno Siegel)
    Re: parsing with HTML::TokeParser. <gisle@ActiveState.com>
    Re: Pass a value from cgi to cgi <gellyfish@gellyfish.com>
    Re: passing from a korn shell to a perl script <gellyfish@gellyfish.com>
    Re: Perl code for a newbie!! <craig.pugsley@mimesweeper.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 15 Aug 2000 08:51:13 +0100
From: nobull@mail.com
Subject: Re: - Using run time value as arry names????
Message-Id: <u9sns6oqz3.fsf@wcl-l.bham.ac.uk>

"Kiel Stirling" <taboo@comcen.com.au> writes:

> Can I use a value stored in a variable as an arry name?

Yes, symbolic references exist and work as described in the manual so
long as "strict refs" is not in effect.  You should not use symbolic
references if you can possibly help it.

perldoc perlref.

> $buffer{$username}=\@($username)files 

I'm sorry I have no idea what you are trying to so with that syntax on
the RHS.

Best guess is you meant \@{$username . 'files'} but then again you
could have meant just about anything.

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


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

Date: 15 Aug 2000 07:36:45 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Accessing ODBC data using PERL
Message-Id: <8naodt$on$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 18:54:19 +0100 DAWallace wrote:
> Hello Everybody,
> I'm trying to extract information from a Microsoft Access database using
> PERL.  Here's the code...
> 
>     print "Content-Type: text/html\n\n";
>     print "Hello World<br>";
>     use OLE;
>     $cnKwiz = CreateObject OLE "ADODB.Connection" or die "Create Object :
> $!";
>     $cnKwiz->Open('kwizCom');
>     $sql = "Select * from TKC~1~01";
>     $rsKwiz = $cnKwiz->Execute($sql);
>     $out = $rsKwiz->FIELDS('Question')->VALUE;
>     print $out;
> 
> and I'm receiving the following error...
> 
>     Can't call method "FIELDS" on an undefined value at "odbc_test.pl" line
> 8.
> 

You never checked whether $rsKwiz was defined after the line that assigns
to it - you should do so and print out the appropriate error text as
described in the Win32::OLE documentation.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 15 Aug 2000 09:17:09 +0200
From: Mouse <glodalec@yahoo.com>
Subject: ARRAY of HASH values
Message-Id: <3998EE75.387B@yahoo.com>

Hello !

I know, similar problem was posted already.

I have a subroutine which returns array of hashes.

sub SYSGROUP_select
{
   my $sth = $dbh->prepare(qq(SELECT * FROM sysgroup)) ;
   $sth->execute ;

   @ARRAY=();
   while (@row = $sth->fetchrow_array( ))
   {
      %rec=();
      $rec{ sysname } = $row[0];
      $rec{ sysdesc } = $row[1];
      push(@ARRAY,%rec);
   }
   return @ARRAY ;
}

Now I would like to read something like $ARRAY[3]{sysname}.


  my @ARRAY=SYSGROUP_select();
  foreach $HASH (@ARRAY)
  {
     my %rec=%$HASH;
     print $rec{ sysname }," ",$rec{ sysdesc },"\n";  <--- Doesnt work
  }


Any help would be appreciated.


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

Date: 15 Aug 2000 04:43:46 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Array Printing
Message-Id: <8nb3ci$5u5$1@provolone.cs.utexas.edu>

In article <MPG.14026795b4b5d36598ac7b@nntp.hpl.hp.com>,
Larry Rosler  <lr@hpl.hp.com> wrote:
>In article <x7r97rxk0p.fsf@home.sysarch.com>, uri@sysarch.com says...
>> >>>>> "LS" == Logan Shaw <logan@cs.utexas.edu> writes:
>> 
>>   >>> print map ("$_\n", @block);
>>   >>> 
>>   >> or even to shave a couple of pecks: 
>>   >> 
>>   >> print "$_\n" for @block;
>> 
>>   LS> Yes, but if @block contains n elements, the for loop version
>>   LS> version will make n system calls (to write).
>> 
>> never say that something in perl is more efficient without
>> benchmarking.
>
>Also, the many calls to print do *not* translate to many system calls to 
>write, because of buffering in the stdio library.

O.K., first of all, I have to admit I'm wrong that the map version will
only make one system call.  I had been laboring under the
misapprehension that calling perl's print on a list would trigger a
writev system call, at least if the list were sufficiently large.
Apparently, this isn't the case, so I don't know where I got that
notion.

Second, though, I have to point out that, according to tests I just
did, a system call actually will be made for each line of output, at
least if the output is a terminal.  (This is with perl 5.6.0 on
Solaris 8.)  This turns out to be the case whether you pass a list
to print or whether you call print once for each item in the list.

  - Logan


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

Date: 15 Aug 2000 07:28:29 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Ascii highlight code?
Message-Id: <slrn8phs8t.oag.vek@pharmnl.ohout.pharmapartners.nl>

On Mon, 14 Aug 2000 16:07:29 +0100,
             Steven O'Driscoll <odriscol@lucent.com> wrote:


>I have written a perl prog to list manpage contents as html, my problem is that 
>I can't display highlighted text it displays 4 of each character, so options 
>becomes ooooppppttttiiiioooonnnnssss. To remove underlined text I use 
> s/_\010//g; I just need the code for highlighted text, unless I'm missing
>something more fundamental. I use nroff to format the man page.
>Any help greatly appreciated.
>
>Steven O'Driscoll



And the non-Perl solution, if you don't mine:

Pipe the output from man or nroff through 'col -bx'.  The col program
with the -b option is designed to get rid of these backspace sequences
and it eats the ^M and ^L in the process as well.  Check the man page
for what the -x option does.



Villy


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

Date: 15 Aug 2000 07:43:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can't call a script from html created by another script
Message-Id: <8naoq6$p4$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 18:04:43 +0100 Rob wrote:
> Hi,
> This ones been getting to me for a while now, so I'm swallowing my pride,
> ready for a barrage of critisism;
> 
> Basically I have a Perl script that takes a load of inputs from a standard
> HTML form, checks all of them against a MS Access database file and creates
> some HTML to display the results, fairly simple and no problems with it. In
> the html created there are a few hidden form fields and a submit button.
> That calls another script which does basically the same as the first but
> sets a cookie as well. Again not a problem, but with this I have a problem.
> In fact I don't - both scripts work exactly as intended under winNT running
> Apache for NT, but the people hosting the site are using IIS and when
> uploaded there the first script still works great but when you click the
> button to get to the second - nothing, just a connecting to <server address>
> in the status bar. 

Then it is unlikely to be a Perl problem - more likely with the server
environment, the HTML that you are outputting or some other factor not
directly related to Perl - I would suggest that you ask in one of the
comp.infosystems.www.* groups in the first instance.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Sun, 13 Aug 2000 20:02:35 +0100
From: "John Gold" <gold@kr8.com>
Subject: Cookie refresh problem under netscape commmunicator
Message-Id: <8n6sd9$5eq$1@venus.telepac.pt>

Hi,
not sure if this is the right list but I have a problem refreshing a cookie
under netscape navigator, works fine in explorer, strangely I appear to be
recieving the cookie values from the cache and not the cookie under
navigator, does anybody have any suggestions, or is this a known bug?

thanks,

John

email john@kr8.com




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

Date: Tue, 15 Aug 2000 11:05:23 +0200
From: "Marr, Lincoln [HOOF:4713:EXCH]" <lincolnmarr@europem01.nt.com>
Subject: Re: date and time in perl
Message-Id: <399907D3.E304A03B@europem01.nt.com>

Try this, I used it and it works beautifully:
=============================================
sub get_date  {
local ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst,$date);
local (@days, @months);
@days =
('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
@months =
('January','February','March','April','May','June','July','August','September','October','November','December');
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
if ($hour < 10)    {    $hour = "0$hour";    }
if ($min < 10)     {    $min = "0$min";    }
if ($sec < 10)    { $sec = "0$sec";    }
$mon++;
$year += 1900;
$date = "$mon/$mday/$year at $hour\:$min\:$sec";
return $date;
}
$time = &get_date;
=================================================
Lincoln.


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

Date: Tue, 15 Aug 2000 09:19:59 +0200
From: "haggi@work" <haggi@tappe.net>
Subject: Re: dr watson
Message-Id: <3998EF1F.D8C58623@tappe.net>


Oh, I tried this, but then a window pops up which means:

"Sorry! Try a professional operation system before you can get help."

:)



Abigail wrote:
> == I start an shell command with perl on WinNT(SP5) and check the output.
> == but sometimes this command produces an error with the "dr. watson" window.
> 
> Perhaps you should use the "sherlock holmes" window instead.
> 
> Abigail
> --

-- 

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

	haggi
	www.haggi.de
	haggi@haggi.de

	haggi`s visual effects & animation

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


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

Date: 15 Aug 2000 10:04:51 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: dr watson
Message-Id: <8nb4k3$h01$1@lublin.zrz.tu-berlin.de>

Abigail <abigail@foad.org> wrote in comp.lang.perl.misc:
>haggi@work (haggi@tappe.net) wrote on MMDXL September MCMXCIII in
><URL:news:39979719.C9C7BDF3@tappe.net>:
>== 
>== I start an shell command with perl on WinNT(SP5) and check the output. 
>== but sometimes this command produces an error with the "dr. watson" window. 
>
>Perhaps you should use the "sherlock holmes" window instead.

Yes, but he'd have to run MacOS for that.

Anno


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

Date: 15 Aug 2000 07:30:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: force ascii file upload with cgi.pm
Message-Id: <8nao2e$o7$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 18:09:05 GMT GSG wrote:
> I am using cgi.pm to upload multiple files to a server. I need to force
> ascii transfer. The way it is now, it is putting newlines or carriage
> returns inbetween each line of my data (I am transferring a csv file).
> 
> here is my code:
> 
> open (OUTFILE, ">$basedir/$fileName");
> while (my $bytesread = read($file, my $buffer, 1024)) {
> print OUTFILE $buffer;
> }
> close (OUTFILE);
> 
> What can I add to force this as an ascii transfer?

binmode OUTFILE;
binmode $file;

And you will check the success of the open to the output file won't you ?

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 15 Aug 2000 18:52:07 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: Re: Help a little needed from regex expert please
Message-Id: <us7m5.4$WN2.780@nsw.nnrp.telstra.net>

Thanks
Thats exactly what I needed. I was going crosseyed with all the dots and
squiggles I think.

Appreciate your help,

regards
Robert


"Jordan Katz" <katz@underlevel.net> wrote in message
news:m3k8dj3xh5.fsf@underlevel.underlevel.net...
> "Robert Chalmers" <robert@chalmers.com.au> writes:
>
> > Hi,
> > I have a string like this.
> >
> > No match for "CCSCHINO.COM".
> >
> >
> > Exactly like this, even with the full-stop (period) at the end, and the
""
> > quote marks.
> >
> > What I need to do is extract ONLY the word  between the "", ie, in this
> > case - CCSCHINO.COM
> >
> > Nothing I try returns that. Everything else.... !!!  but not that.
> >
> > Does anyone have any clues please.
> > Thanks very much for any help
>
> Try:
>
>   my $str = "\"CCSCHINO.COM\".";
>   my $result;
>   if ($str =~ /"(.*)"/) {
>       $result = $1;
>   }
>   print $result;
> --
> Jordan Katz <katz@underlevel.net>




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

Date: 15 Aug 2000 07:50:30 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to execute perlscript from html site
Message-Id: <8nap7m$pv$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 11:54:15 GMT Pierre wrote:
> Hi All!
> I have a simple question.
> How can I start perlscript from htm site?
> 

The same was a you would run a program written in Tcl or C - you would
be better off asking in one of the comp.infosystems.www.* newsgroups
where they are happy to deal with general WWW type questions.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 15 Aug 2000 04:29:37 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: ignore IP address
Message-Id: <8nb2i1$5rp$1@provolone.cs.utexas.edu>

In article <3998a4e9.15372986@news>,  <noway@nohow.com> wrote:
>Thank you very much I have a starting point. If you havn't figured it
>out, I'm a total newbie. [smile]
>
>More accurately, this is what I'm trying to do:
>I have a Statistics script running on my web page.
>I want it run, but not count me. (my IP)
  :
  :
>Is there a way to do a "goto" like in a batch file?
>i.e. get it to skip the part of the script that adds the count to it's
>database.

You could do that, but it'd be better to just use an "if" statement.
Something like this:

	if ($ENV{REMOTE_ADDR} ne "1.2.3.4")
		{
		# code that updates database goes here
		}

The "ne" compares the two strings and returns a true result if
they're not equal.  So, the code inside the brackets will be
executed only if the two aren't equal.  Perl also allows a slightly
different way to do it which would be clearer in this case:

	unless ($ENV{REMOTE_ADDR} eq "1.2.3.4")
		{
		# code that updates database goes here
		}

Hope that helps.

By the way, if you're interested, there is a famous
paper called "Go To Statement Considered Harmful"
available at http://www.acm.org/classics/oct95/ .

  - Logan


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

Date: 15 Aug 2000 08:30:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: matching starting html code
Message-Id: <8naria$sr$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 00:44:16 GMT sung wrote:
> On Mon, 14 Aug 2000 00:29:48 GMT, JonB9@aol.com wrote:
> 
>>how can i match all the code from <html> to <body ...>???
>><html>[.\n]{0,}<head>[.\n]{0,}<\/head>[.\n]{0,}<body[.\n]{0,}>
>>
>>
>>Sent via Deja.com http://www.deja.com/
>>Before you buy.
> 
> This should work:
> 
> /<html>(.*?)<\/html>/
> 

What, in the face of uppercase tags, attributes to the HTML tag, multiple
lines or a comment containing '</html>' in the document ? *And* this doesnt
follow the requirement of only getting the head part of the document.

I would recommend using HTML::Parser.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 15 Aug 2000 08:23:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MS Word 2000 using Win32::OLE
Message-Id: <8nar5h$s6$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 03:00:33 -0700 Dawson Cowals wrote:
>                          I'm having no problem launching an instance of
> word, getting it to minimize, run in the background, open the files in
> the tree I specify and go through the whole tree recursively. However,
> I'm trying to then run a macro on each file I'm opening, and this macro
> resides in a template file.
> 

You might find that you will have better luck in asking in one of the
Win32 specific mailling lists that can be found via the Activestate site
<http://www.activestate.com> whilst there are undoubtedly people reading
this newsgroup who might be able to answer you the mailling lists largely
of people who are interested in programming for windows (or are forced
to work with it).

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 15 Aug 2000 03:23:13 -0400
From: "karamazov" <hello@hello.com>
Subject: need help with msql and perl
Message-Id: <8nar9b$8gd$1@slb7.atl.mindspring.net>

i am writing a script using the dbd::msql driver to access a small msql db.
the prob i have is with a query i am trying to process.  here is the code
for it:

my $dbh=DBI->connect($db, $dbName);
my $statement= "select mov_index, mov_title, mov_year,mov_rating from movie
where mov_avail= 'Y'   \g";
my $sth=$dbh->prepare($statement);

for some reason the query won't execute when i call $sth->execute.  i get
parse errors.  what is wrong with this?







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

Date: Tue, 15 Aug 2000 07:31:36 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Negativity in Newsgroup -- Solution
Message-Id: <slrn8pht2m.393.tim@degree.ath.cx>

On Mon, 14 Aug 2000 14:39:43 -0400, Lou Moran <lmoran@wtsg.com> wrote:
> >> I don't think Randal was expecting the Spanish Inquistion.
> >No one expects the Spanish Inquisition!
> Actually the Knights Templar were expecting it and as such most
> escaped it... 

Get the comfy chair!

*gasp!*

-- 
-Tim Hammerquist <timmy@cpan.org>

Ted's got a mind like a steel sieve.
	-- Woody Allen, "Manhatten Murder Mystery"


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

Date: Mon, 14 Aug 2000 17:46:25 +0100
From: "George Crane" <georgec@webleicester.co.uk>
Subject: Re: Newbie post problem.
Message-Id: <xK6m5.1374$nX5.40255@news1-hme0>

Thanks Colin,

Using cookies is pretty horrible as a solution in this case. The path_info
idea is better but still pretty limiting. I cracked it this afternoon
though by using a socket. I posted my custom headers (request - content type
and content length) through a socket with my URLencoded form body. This
works just fine.

However, I started looking at using NPH-* scripts as an alternative way of
sending information but I suppose as soon as you write print you are writing
a response header. So this idea wont work I guess ( as you said you are
talking to the browser) yep, I found it a bit of a mind *k!!

Appreciate your help,

Regards

George






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

Date: Tue, 15 Aug 2000 09:04:59 +0100
From: "George Crane" <georgec@webleicester.co.uk>
Subject: Re: Newbie post problem.
Message-Id: <yK6m5.1375$nX5.40255@news1-hme0>

Thanks,

In the end I used a socket to shunt my request back to the non secure
server. It works just fine and dandy. I can see why you cant use HTTP for
this kind of thing. It introduced me to nph-* scripts which are
interesting - useless but interesting.

Thanks for you comments.

George


nobull@mail.com wrote in message ...
>"George Crane" <georgec@webleicester.co.uk> writes:
>
>> print "location: backtotheserver.htm?allmyinformation=here"
>>
>> However, if I do that Im gonna get an ugly string across the location
field
>> in the browser. Ideally, I want to use the Post method but I cant figure
out
>> how to return to a page on the normal server using post and add all the
>> relevant headers for field content.
>
>The HTTP protocol provides no way for a server to instruct the client
>to perform a POST request with a different request body.  There are





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

Date: 15 Aug 2000 08:16:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Newbie post problem.
Message-Id: <8naqnl$rp$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 12:52:14 GMT Colin Keith wrote:
> In article <%GPl5.1218$nX5.36480@news1-hme0>, "George Crane" <georgec@webleicester.co.uk> wrote:
>>However, if I do that Im gonna get an ugly string across the location field
>>in the browser. Ideally, I want to use the Post method but I cant figure out
> 
> You can't tell the browser how to send data and in theory it matters little 
> to either end which method is used, 

It should do (rfc2616) :

   In particular, the convention has been established that the GET and
   HEAD methods SHOULD NOT have the significance of taking an action
   other than retrieval. These methods ought to be considered "safe".
   This allows user agents to represent other methods, such as POST, PUT
   and DELETE, in a special way, so that the user is made aware of the
   fact that a possibly unsafe action is being requested.

>                                    except that URL's are *supposed* to have 
> a maximum length (256characters?).

(again rfc2616):

   The HTTP protocol does not place any a priori limit on the length of
   a URI. Servers MUST be able to handle the URI of any resource they
   serve, and SHOULD be able to handle URIs of unbounded length if they
   provide GET-based forms that could generate such URIs. A server
   SHOULD return 414 (Request-URI Too Long) status if a URI is longer
   than the server can handle (see section 10.4.15).

Although it does go on to make some caveats about servers treating
a URI of longer than 255 characters with caution because some client and
proxy software doesnt handle them properly.

Anyhow I've set the followups as this has got nothing to to do with Perl.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 15 Aug 2000 01:10:01 -0700
From: Peter_Gadsby <peter_gadsbyNOpeSPAM@hfcbank.co.uk.invalid>
Subject: Re: Oracle connectivity using Perl
Message-Id: <307b1660.ff363d88@usw-ex0102-014.remarq.com>

Hi Erik,

I am passing a parameter to the script from an HTML page, the
call is as follows .....
<P>
<A HREF="http://xxxxxxxx/dev-cgi-bin/test2.pl?zzzz"
target="A2">DB Locks</A>

It works most of the time with the previous version of the Perl
script (with Oraperl - occasionaly core dumping! ).

The reason I am passing a parameter is because I want to use one
Oracle database to collect the statistics from a number of other
databases, so I have created Oracle database links to the other
databases, and this parameter is supposed to be the link name.

Do you think this is what's causing the problem... Are you
telling me that I can't pass parameters to Perl, what is the
alternative.....!!!!!

I will look at the HTTP error log, and the FAQ to see what the
server side problem might be. If you could help any further it
would be much appreciated.

Cheers
Peter_Gadsby@hfcbank.co.uk



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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: 15 Aug 2000 09:42:56 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Organizing and verifying a set of tree structures
Message-Id: <8nb3b0$gu2$1@lublin.zrz.tu-berlin.de>

Abigail <abigail@foad.org> wrote in comp.lang.perl.misc:

>I seriously suggest looking into 'Cormen, Rivest, Leiserson: Introduction
>to Algorithms'.

Oh, a book recommendation from Abigail.  Now where did I put the my
bookstore's URL?

Anno


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

Date: 15 Aug 2000 10:31:36 +0200
From: Gisle Aas <gisle@ActiveState.com>
Subject: Re: parsing with HTML::TokeParser.
Message-Id: <m3ya1zrklz.fsf@eik.g.aas.no>

johnvert@my-deja.com writes:

>  I want to use HTML::TokeParser to parse stuff between tags, i.e.
> 
>    <T>Blah</T>
> 
>  And retrieve 'Blah'.  I tried the following:
> 
>    $p=HTML::TokeParser->new("file");
>      while($line=$p->get_token("<T>"))

get_token() does not take any arguments.

>      {
>        my $text=$p->get_trimmed_text;
>        print "$text\n";
>      }
> 
>  Taken from the HTML::TokeParser examples.  The problem is, the stuff
>  between <T> and </T> is a set of more tag, not just plain text, and I
>  simply want to retrieve these tags -as is-.  Example:
> 
>    <T><f>f</f><d c="left"></d></T>
> 
>  I want it to return: <f>f</f><d c="left"></d>
> 
>  How can I achieve that with HTML::TokeParser?

You would have to use get_token and then print any $text it returns.
One problem is that the $text is not in a fixed location for various
token types, so we use a hash to look it up.

This program should work:

------------------------------------------------------------------
use HTML::TokeParser;
my %TEXT_INDEX = ( S  => 4, E  => 2, PI => 2 );

my $p = HTML::TokeParser->new("file");
while (my $t = $p->get_token) {
    my($type, $tag) = @$t;
    if (($tag eq "t" && $type eq "S")
         ..
        ($tag eq "t" && $type eq "E"))
    {
	# we are between <t>...</t>
	print $t->[$TEXT_INDEX{$type} || 1];
    }
}
print "\n";


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

Date: 15 Aug 2000 07:44:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Pass a value from cgi to cgi
Message-Id: <8naos0$p7$1@orpheus.gellyfish.com>

On Tue, 15 Aug 2000 01:02:48 +0800 Mark wrote:
> I want to pass a value from abc.cgi to xyz.cgi by sumitting a form.
> The xyz.cgi contains a hidden value that will be pushed into an array.
> 
> While the submit action in abc.cgi was taking, the hidden value in
> xyz.cgi will be automatically pushed into the array firstly, then the
> passed value of abc.cgi will be appended into the array.
> 

You will probably want to use LWP::UserAgent.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: 15 Aug 2000 07:46:35 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: passing from a korn shell to a perl script
Message-Id: <8nap0b$pi$1@orpheus.gellyfish.com>

On Mon, 14 Aug 2000 11:55:46 -0500 GI812 wrote:
> I am trying to pass a filename to a perl script.  The file will be
> different everytime (otherwise this would have been really
> easy).  I have a korn shell like this:
> 
> ftp -n 137.28.152.112 <<!
> user **** ****
> cd TEMP
> put $1
> bye
> !
> record.p $1
> 
> I figure I can't really pass the "$1" to my perl script, but was
> wondering how I could just get the name of the file that is
> ftp'd into a variable in my record.p.  Any ideas?  Would it just be
> easier to do everything in my perl script?
> 

Well  it might be easier to everything in a Perl program - you can use
the module Net::FTP to do the ftp'ing for instance - however the command
line arguments to a Perl program are made available in the array @ARGV
as described in the perlrun and perlvar manpages.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 15 Aug 2000 10:33:06 +0100
From: "Craig Pugsley" <craig.pugsley@mimesweeper.com>
Subject: Re: Perl code for a newbie!!
Message-Id: <l78m5.6315$pR4.128733@news6-win.server.ntlworld.com>

> If you decide to do something different,
> even after being advised of the problem, you have no one but
> yourself to blame if you find things confusing -- or if you end
> up being killfiled and ignored by the people you're trying to
> get a response from.

I accept full responsibility for trying to be different. I've only been
doing this newsgroups thing for about a week now, and have found that each
different channel has its own 'character'.

I think I'm getting a general idea as to the 'character' of this newsgroup.

I reaffirm my original comments:

> I was making a (slightly
> blanketed, admittedly) comment on the general state of affairs in the
> tech-community on the web. Why should I have to quote examples just to
> justify my (personal) comments? I think [generally, people's] comments
seem to encapsulate exactly the extent to
> which the tech community has disappeared up its own (proverbial) backside.

Please note the format and structure of my quoted comments? Do you feel that
carry more weight now?

Oh dear me.

CraigP

"Keith Calvert Ivey" <kcivey@cpcug.org> wrote in message
news:3999c900.1514188@news.newsguy.com...
> "Craig Pugsley" <craig.pugsley@mimesweeper.com> wrote:
>
> >There are several sub-threads under my initial main question. At one
point,
> >it digresses into this totally different comment altogether! I admit, it
is
> >getting slightly confusing! Persist.
>
> It's hard to have a discussion with someone who refuses to
> follow the conventions of Usenet discussions.  Note that other
> people in the thread quote only the relevant parts of the
> messages they're responding to and put their responses *after*
> the quoted material.  If you decide to do something different,
> even after being advised of the problem, you have no one but
> yourself to blame if you find things confusing -- or if you end
> up being killfiled and ignored by the people you're trying to
> get a response from.
>
> --
> Keith C. Ivey <kcivey@cpcug.org>
> Washington, DC




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

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


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