[22698] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4919 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 1 00:05:52 2003

Date: Wed, 30 Apr 2003 21:05:07 -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           Wed, 30 Apr 2003     Volume: 10 Number: 4919

Today's topics:
    Re: built in function 'map' examples? <willis3140@yahoo.com>
    Re: Comparing strings with small differences <w.koenig@acm.org>
    Re: CPAN Solaris problem <goedicke@goedsole.com>
    Re: CPAN Solaris problem <tony_curtis32@yahoo.com>
    Re: Elegant test for A in B OR B in A? <mgjv@tradingpost.com.au>
    Re: Elegant test for A in B OR B in A? (Sara)
        Executing a MySQL dump file from within a perl script? (Garam)
    Re: Executing a MySQL dump file from within a perl scri <willis3140@yahoo.com>
        how to disable Lingua::EN::NameParse print to stdout? <bing-du@tamu.edu>
    Re: how to disable Lingua::EN::NameParse print to stdou <skuo@mtwhitney.nsc.com>
    Re: Is it possible to pass @somethig and $something_els <anthony@movielink.net.au>
        Is there any way to debug PerlScript used in ASP? <45724remove@yahoo.com>
    Re: Parsing multiple files and mixing the data (Tad McClellan)
    Re: Parsing multiple files and mixing the data <mgjv@tradingpost.com.au>
    Re: Perl - DBI - How to store connection info in a sepa <glex_nospam@qwest.net>
    Re: Perl Microsoft Server incompatibility? <jurgenex@hotmail.com>
    Re: PerlScript, handbook <s.lepolozec@wanadoo.fr>
        Persistent DB Connections in IIS 5.0 <matt.NO.S.PAM.orders@comm.NO.web.SP.works.AM.com>
    Re: quotemeta matching problem (Tad McClellan)
        tell if script is linked to not typed in?? <dingdongy2k@hotmail.com>
    Re: tell if script is linked to not typed in?? <emschwar@pobox.com>
    Re: waste of time (Tad McClellan)
    Re: waste of time <jurgenex@hotmail.com>
    Re: waste of time <goedicke@goedsole.com>
    Re: What is AutoSearch and where do I find it? <No_4@dsl.pipex.com>
    Re: What is the best software to run for an aspiring Pe (Tad McClellan)
    Re: What is the best software to run for an aspiring Pe <spam@thecouch.homeip.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 01 May 2003 02:28:55 GMT
From: w i l l <willis3140@yahoo.com>
Subject: Re: built in function 'map' examples?
Message-Id: <ri11bvk635tr998ms60u8qjlf96vrgbnb2@4ax.com>

Study the Schwartzian Transform
http://perlmonks.com/index.pl?node_id=9108

-Will

On Wed, 30 Apr 2003 18:03:26 GMT, "Robert" <robert.j.sipe@boeing.com>
wrote:

>The built in 'map' function is really a powerful tool and have used it a
>fair amount.  However, the syntax of its use is still confusing for the more
>elaborate uses.  I have read the perldoc page and studied the Effective Perl
>Programming book but would like to find more examples to draw upon.
>Pointers to good books, webpages, user examples, FAQs... would be
>appreciated.
>
>Thanx in advance.
>



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

Date: Thu, 01 May 2003 00:08:58 +0200
From: Winfried Koenig <w.koenig@acm.org>
Subject: Re: Comparing strings with small differences
Message-Id: <3EB0497A.30007@acm.org>

mlm wrote:
> OK I give up.  How does this work.  It looks like magic to me.  I see 
> that ^ does a bitwise XOR OK.  But what is \000 matching?  A binary 
> number?  I can't figure out how the difference is extracted.  I was not 
> aware you could treat $+ and $- as arrays.
> 
> Thanks
> Mark
> 
> 
> mlm <mlm@nospam.com> wrote in news:yVCdnbUOMcxlszKjXTWcog@giganews.com:
> 
> 
>>Hey that is a great help Winfried.  I am working out how it works now 
>>...
>>
>>Thanks
>>mark
>>
>>
>>Winfried Koenig <w.koenig@acm.org> wrote in news:3EAD9204.9010508
>>@acm.org:
>>
>>
>>>#!/usr/local/bin/perl
>>>
>>>use strict;
>>>use warnings;
>>>
>>>my @a = (
>>>     "Polka dot (18), sheet 07.",
>>>     "Polka dot (19), sheet 07.",
>>>     "Polka dot (20), sheet 07.",
>>>);
>>>
>>>foreach my $i (1 .. $#a) {
>>>     my $diff = $a[$i -1 ] ^ $a[$i];
>>>     if ($diff =~ m/[^\000]+/) {
>>>         printf "%d,%d\n", $-[0], $+[0] - $-[0];
>>>     }
>>>}
>>>

Hi Mark,

I hope this helps:

  a  b  c  d  e  f  g            # string 'abcdefg'
  61 62 63 64 65 66 67           # hex representation of string 'abcdefg'
  a  b  c  D  E  f  g            # string 'abcDEfg'
  61 62 63 44 45 66 67           # hex representation of string 'abcDEfg'
  --------------------
  00 00 00 20 20 00 00           # exclusiv or of both strings (hex)
   0  1  2  3  4  5  6           # positions in strings
            3                    # value of $-[0] after match
                  5              # value of $+[0] after match

The regular expression m/[^\000]+/ matches the first sequence of
characters not containing a \000 character.

For @- and @+ see 'perldoc perlvar'. Search for the strings
'LAST_MATCH_START' and 'LAST_MATCH_END'.

Winfried




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

Date: Thu, 01 May 2003 02:14:59 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: CPAN Solaris problem
Message-Id: <m3smrz1kh8.fsf@mail.goedsole.com>

Dear Tony - 

Tony Curtis <tony_curtis32@yahoo.com> writes:

> This means the perl installation you're extending with
> CPAN modules was originally built with "cc" (presumably
> some version of Workshop/Forte/Studio in this instance).

But that's the confusing thing.  I only recently built perl on this
box myself and the first challenge I faced was getting the perl build
to recognize that "cc" wasn't there.  Only /usr/local/bin/gcc was on
the box.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

We are all insecure.

		- Joan Menard


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

Date: Wed, 30 Apr 2003 21:19:04 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: CPAN Solaris problem
Message-Id: <874r4fh0iv.fsf@limey.hpcc.uh.edu>

>> On Thu, 01 May 2003 02:14:59 GMT,
>> William Goedicke <goedicke@goedsole.com> said:

> Dear Tony - Tony Curtis <tony_curtis32@yahoo.com>
> writes:

>> This means the perl installation you're extending with
>> CPAN modules was originally built with "cc" (presumably
>> some version of Workshop/Forte/Studio in this
>> instance).

> But that's the confusing thing.  I only recently built
> perl on this box myself and the first challenge I faced
> was getting the perl build to recognize that "cc" wasn't
> there.  Only /usr/local/bin/gcc was on the box.

Did you put *your* perl somewhere like /usr/local, but
CPAN is picking up the perl in /usr/bin/perl which is a (n
installed) link to /usr/perl5/bin/perl ?

Commands such as

    which perl
    which cpan

may provide some enlightenment.  If not, hmm,
intriguing...

hth
t


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

Date: Wed, 30 Apr 2003 23:12:09 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Elegant test for A in B OR B in A?
Message-Id: <slrnbb0m2a.3gj.mgjv@verbruggen.comdyn.com.au>

On 30 Apr 2003 17:34:33 GMT,
	Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Tina Mueller  <usenet@tinita.de> wrote in comp.lang.perl.misc:
>> Sara <genericax@hotmail.com> wrote:
>> 
>> > I have an array of names and a scalar. Basically I want to know if the
>> > scalar is in the array of names, but unfortunately, either the scalar
>> > or the array elements can be abreviated.
>> 
>> for (@array) {
>>  print unless index($x,$_) && index ($_,$x)
>> }

[snip]

> Just a pity it's a little hard to read.  It's amazing what a single
> negation can do to obfuscate logic.  If one were to define

[snip]

I do agree that unless with logical operators can get very confusing.
Whenever I end up in that situation, I tend to do something like:

print if index($x, $_) == 0 or index ($_, $x) == 0;

which is a lot more clear.

I also don't like pretending that the return value of index is a
boolean value, even though it can, of course, be used as one. Explicit
comparison against a wanted value is clearer to my eye.

Martien
-- 
                        | 
Martien Verbruggen      | 
Trading Post Australia  | "Mr Kaplan. Paging Mr Kaplan..."
                        | 


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

Date: 30 Apr 2003 18:54:32 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: Elegant test for A in B OR B in A?
Message-Id: <776e0325.0304301754.743e89f2@posting.google.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<b8olhr$7h$1@mamenchi.zrz.TU-Berlin.DE>...
> Sara <genericax@hotmail.com> wrote in comp.lang.perl.misc:
> > Good Morn Perlistas:
> > 
> > I have an array of names and a scalar. Basically I want to know if the
> > scalar is in the array of names, but unfortunately, either the scalar
> > or the array elements can be abreviated.
> > 
>         for ( @a ) {
>             ( $x ^ $_) =~ /^\0*/;
>             $match = ( $+[ 0] == length $x or $+[ 0] == length $_);
>             last if $match;
>         }
>         $match;
>     }
> 
> 
> With "@names = qw(catbird mouse eel)" we get
> 
>     match_either_way( 'cat', @names)        # true
>     match_either_way( 'cati', @names)       # false
>     match_either_way( 'eelephant', @names); # true
> 
> Anno

Thanks Anno, Andreas, and everyone- I appreciate the time you took to
think about this and reply. I think for me the index() test proposed
by Andreas looks the most appealing and certainly passes the brevity
test!

Cheers,
S


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

Date: 30 Apr 2003 19:04:43 -0700
From: garam@swirve.com (Garam)
Subject: Executing a MySQL dump file from within a perl script?
Message-Id: <e3bd9f4b.0304301804.63f0fbd4@posting.google.com>

I have an SQL file created by MySQL dump in the from of:

-- MySQL dump 8.22
--
-- Host: localhost    Database: database
---------------------------------------------------------
-- Server version	3.23.52

--
-- Table structure for table 'tablename'
--

CREATE TABLE tablename (
 ...

It contains a bunch of CREATE TABLE statements. Does anyone know how I
can execute the statements in this file from within a Perl script
(preferably using DBI, not by using the shell)?


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

Date: Thu, 01 May 2003 02:25:34 GMT
From: w i l l <willis3140@yahoo.com>
Subject: Re: Executing a MySQL dump file from within a perl script?
Message-Id: <k211bvotp55kvdr2m9iadjrj2f6782q9b9@4ax.com>

something like this maybe.......


#!/usr/bin/perl
#THIS IS UNTESTED!!!
use strict;
use DBI:


my $database = "xxx";
my $hostname = "xxxxxx";
my $username = "xxx";
my $password = "xxxx";

my $dbh = DBI->connect("DBI:mysql:$database:$hostname", 
	     $username, $password) || die $DBI::errstr;

open(FILE,"sql.dump");

for (<FILE>) {
	#if the first word is CREATE or INSERT give
	#that line to the sub
	&doSQL($_) if /^CREATE|^INSERT/;
}

&doSQL {
my $clause = shift;
my $sth = $dbh->prepare($clause ) || die $DBI::errstr;
$sth->execute() || die  $sth->errstr();
}




On 30 Apr 2003 19:04:43 -0700, garam@swirve.com (Garam) wrote:

>I have an SQL file created by MySQL dump in the from of:
>
>-- MySQL dump 8.22
>--
>-- Host: localhost    Database: database
>---------------------------------------------------------
>-- Server version	3.23.52
>
>--
>-- Table structure for table 'tablename'



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

Date: Wed, 30 Apr 2003 17:30:02 -0500
From: Bing Du Test <bing-du@tamu.edu>
Subject: how to disable Lingua::EN::NameParse print to stdout?
Message-Id: <3EB04E6A.BF5A2640@tamu.edu>

This is perl, v5.6.1 built for sun4-solaris.
Lingua::EN::NameParse version 1.18.

Lingua::EN::NameParse has 'print' in it.  It spits the following stuff
when the module is called in my script.

Assembling with: <blah blah>
Name = <Lingua::EN::NameParse=HASH(0x3e5f4)>, input_string = < blah
blah>

I don't want to modify Lingua::EN::NameParse.pm itself.  Anyway to
disable the above module outputs?

Thanks in advance for any help,

Bing



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

Date: Wed, 30 Apr 2003 18:51:03 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: how to disable Lingua::EN::NameParse print to stdout?
Message-Id: <Pine.GSO.4.21.0304301843500.25777-100000@mtwhitney.nsc.com>

On Wed, 30 Apr 2003, Bing Du Test wrote:

> This is perl, v5.6.1 built for sun4-solaris.
> Lingua::EN::NameParse version 1.18.
> 
> Lingua::EN::NameParse has 'print' in it.  It spits the following stuff
> when the module is called in my script.
> 
> Assembling with: <blah blah>
> Name = <Lingua::EN::NameParse=HASH(0x3e5f4)>, input_string = < blah
> blah>
> 
> I don't want to modify Lingua::EN::NameParse.pm itself.  Anyway to
> disable the above module outputs?
> 
> Thanks in advance for any help,
> 
> Bing





Perhaps you want to temporarily redirect STDOUT (or whichever
filehandle to which Lingua::EN::NameParse is printing)?  I've not
looked at Lingua::EN::NameParse, but if it's anything like this
example:


     1	#! /usr/local/bin/perl
     2	
     3	package Verbose;
     4	use base qw(Exporter);
     5	@EXPORT_OK = qw(bar);
     6	
     7	use strict;
     8	use warnings;
     9	
    10	print "foo\n";  # unwanted message
    11	
    12	sub bar {
    13	    print "bar\n";
    14	}
    15	
    16	1;
    17	


Then you can try 'require' (and import) in the BEGIN block, after
having redirected STDOUT:


     1	#! /usr/local/bin/perl
     2	use strict;
     3	use warnings;
     4	
     5	BEGIN {
     6	    open(SAVEOUT,">&STDOUT")
     7		or die "Could not backup STDOUT: $!";
     8	    open(STDOUT, ">/dev/null")
     9		or die "Could not redirect STDOUT: $!";
    10	    require Verbose;
    11	    import Verbose qw(bar);
    12	    open (STDOUT,">&SAVEOUT") 
    13		or die "Could not restore STDOUT: $!";
    14	    close SAVEOUT 
    15		or warn "Could not close extra FILEHANDLE: $!";
    16	}
    17	
    18	bar();



-- 
Hope this helps,
Steven



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

Date: Thu, 01 May 2003 09:03:16 +1000
From: "Tony" <anthony@movielink.net.au>
Subject: Re: Is it possible to pass @somethig and $something_else to sub
Message-Id: <pan.2003.04.30.23.03.14.522324@movielink.net.au>

On Wed, 30 Apr 2003 15:22:14 +0000, Uri Guttman wrote:

>>>>>> "JS" == John Strauss <john.thetenant-s@moving-picture.com> writes:
> 
>   >> >>>>> "T" == Tony  <anthony@movielink.net.au> writes:
>   >> 

> i would bet on that too. maybe some dirty socks if not my shirt. :)

Well, you jumped to conclusions :-))

I do read all and sundry...including the silly replies
that may assume that the poster has programming experience :-) 

My perl experience is very new, as is my general programming
knowledge.  I beleive that term is "newbie..."

> and i hate to think that the OP has a 'working' solution and won't come
> back to this thread to learn more.

Yes I am back - reading lots of these posts has helped.  Getting a
better grip on how and where to find DOCS on specific items has
been good.  When I try to get something to run the thing gets
typed up in its simplest form to test it, hense the way
of printing out via what seems a silly method....

If I were to post all my code when there is only specific parts
causing trouble, soem other readers here would shoot me down in
flames...it is very helpful for me to test out things like this
before committing it to the final code - that seems to save
me some trouble...  

Well, bye for now - until the next problem arises.

Tony
> uri

-- 
--------------------------------------------------------------
To reply directly send to: anthony AT movielink DOT net DOT au
Replace AT and DOT with @ and . and mail will get through.
Any spammers will be persued until they get booted off the net



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

Date: Wed, 30 Apr 2003 22:57:13 -0400
From: "Andrew" <45724remove@yahoo.com>
Subject: Is there any way to debug PerlScript used in ASP?
Message-Id: <b8q2df$camns$1@ID-51798.news.dfncis.de>

Is there any way to debug PerlScript used in ASP?




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

Date: Wed, 30 Apr 2003 17:20:12 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Parsing multiple files and mixing the data
Message-Id: <slrnbb0j0s.58o.tadmc@magna.augustmail.com>

Martin McKenny <r1534c@motorola.com> wrote:
> Hi All,
> 
> I want to read in the lines of multiple files in parallel in order to merge
> the elements of each file.
> 
> So if we have three files with listed data as follows:
> 
> File1 contains data: a1 a2 a3
> File2 contains data: b1 b2 b3
> File3 contains data: c1 c2 c3
> 
> I want to merge these to get a file containing
> 
> Output file : a1 b1 c1 a2 b2 c2 a3 b3 c3


Untested.

open A, 'File1' or die "could not open 'File1' $!";
open B, 'File2' or die "could not open 'File2' $!";
open C, 'File3' or die "could not open 'File3' $!";
while ( <A> ) {
   print;
   print scalar(<B>);
   print scalar(<C>);
}
close A;
close B;
close C;


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


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

Date: Wed, 30 Apr 2003 22:53:18 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Parsing multiple files and mixing the data
Message-Id: <slrnbb0kuv.3gj.mgjv@verbruggen.comdyn.com.au>

On Wed, 30 Apr 2003 18:29:47 +0100,
	Martin McKenny <r1534c@motorola.com> wrote:
> Hi All,
> 
> I want to read in the lines of multiple files in parallel in order to merge
> the elements of each file.
> 
> So if we have three files with listed data as follows:
> 
> File1 contains data: a1 a2 a3
> File2 contains data: b1 b2 b3
> File3 contains data: c1 c2 c3

So, each line only contain ones line, correct?

> I want to merge these to get a file containing
> 
> Output file : a1 b1 c1 a2 b2 c2 a3 b3 c3

Maybe:

perl -wpe 'END { print "\n" } s/\n/ /' file1 file2 file3

This has an extra space at the end of the line, before the \n. If
that's a problem, it's a bit more work.

> I need to do this as effieciently as possible as the files in question
> contain hundreds of thousands of data elements.

All on one line?

Martien
-- 
                        | 
Martien Verbruggen      | Begin at the beginning and go on till you
Trading Post Australia  | come to the end; then stop.
                        | 


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

Date: Wed, 30 Apr 2003 18:02:28 -0500
From: Jeff D Gleixner <glex_nospam@qwest.net>
Subject: Re: Perl - DBI - How to store connection info in a separate file
Message-Id: <uyYra.420$xb4.73442@news.uswest.net>


>>I was wondering if anyone knows the syntax to include DBI connection
>>info in a separate file and make a call to it from a perl dbi script. [...]

If you're using MySQL, check the MySQL docs for "mysql_read_default_file".



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

Date: Wed, 30 Apr 2003 22:48:13 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl Microsoft Server incompatibility?
Message-Id: <NoYra.2058$XF5.1767@nwrddc03.gnilink.net>

Marshall Dudley wrote:
> Thanks, it works now.  Dang I hate MS products.
>
> Marshall
>
> Simon Andrews wrote:
>
>> Marshall Dudley wrote:
>>> I have a perl script that I have installed on numerous unix machines
>>> without any problems.
>>>
>>> However, I am now trying to install it on a Microsoft machine, and
>>> am unable to get it to work.
>>>
>>> The code that is failing is:
>>>
>>> while (sysread(FILE,$max,$bufsize)) {
>>>         print $max;
>>> }
>>
>> perldoc -f binmode
>>
>> You are probably getting windows line endings substituted for unix
>> ones in an inappropriate place.  You should binmode both the input
>> and output filehandles before using them.
>>
>> binmode FILE;
>> binmode STDOUT;
>>
>> while (sysread(FILE,$max,$bufsize)) {
>>          print $max;
>> }
>>
>> Hope this helps

You realize that you will have exactly the same problem on your Unix boxes
when you switch to Perl 5.8?

Your problem has nothing to do with Windows versus Unix. It has to do with
sloppy programming by not using binmode for data files. 'binmode' just
happens to be a no-op on Unix in ASCII-only environment. And probably that's
all you have been exposed to until now.

jue




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

Date: Thu, 1 May 2003 03:22:24 +0200
From: "Stéphane Lepolozec" <s.lepolozec@wanadoo.fr>
Subject: Re: PerlScript, handbook
Message-Id: <b8pssk$bbu$1@news-reader13.wanadoo.fr>

Thanks a lot :)




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

Date: Thu, 01 May 2003 02:28:52 GMT
From: "The Big Friggin Unit" <matt.NO.S.PAM.orders@comm.NO.web.SP.works.AM.com>
Subject: Persistent DB Connections in IIS 5.0
Message-Id: <ED%ra.45640$A41.7009764@news4.srv.hcvlny.cv.net>

I got a script running on IIS5.0 that is accessing an Oracle DB using DBI.
It works great, but every time the script gets called, it takes a good
second or two to go through the overhead of establishing a new DB
connection.

How does one go about setting up a persistent DB connection in IIS 5.0?  My
searches turn up little - maybe I'm looking in the right places.

-Y




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

Date: Wed, 30 Apr 2003 17:09:06 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: quotemeta matching problem
Message-Id: <slrnbb0ic2.58o.tadmc@magna.augustmail.com>

Lars <rispalt@yahoo.se> wrote:
> quote meta drives me crazy :)...
> 
> When I use the Q matching option it works but not when I use the quotemeta 
> function. Should it not give the same result?
> 
> Does not work:
> 
>      $err = quotemeta $buffer{$key}{TRACE};
>      $lin = quotemeta $line;


That mangles the string to be matched. Don't do that. You only want
to mangle the pattern, not the string.


>      chomp $lin;
>      if ( $lin =~ m£\${err}£ ) {
>      
>       }
> Does work:
> 
>     $err = $buffer{$key}{TRACE};
>     $lin = $line;
>     chomp $lin;
>     if ( $lin =~ m£\Q${err}£ ) {
> 
> 
> The string looks like:
> ../../C++/TargetRTS/DrhRfn_insOseProxyC_Actor.cpp:37 1 ERROR:index not found


It looks like that _before_ quotemeta, print it out again after
quotemeta()ing it and see what you've done to it.


> Any ideas?


The first one applies quoting in two places, the second one
applies quoting in one place.


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


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

Date: Thu, 01 May 2003 00:41:06 GMT
From: "Travis" <dingdongy2k@hotmail.com>
Subject: tell if script is linked to not typed in??
Message-Id: <C2_ra.47590$ey1.4435843@newsread1.prod.itd.earthlink.net>

I have a perl script that I want executed only when it is linked to from
another page.

I do not want it to run if the user types in the url or right clicks it.

How do I do it?

I think it has something to do with checking the method of post or get?


Thanks
Travis




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

Date: 30 Apr 2003 19:13:02 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: tell if script is linked to not typed in??
Message-Id: <eto4r4f79lt.fsf@wormtongue.emschwar>

"Travis" <dingdongy2k@hotmail.com> writes:
> I have a perl script that I want executed only when it is linked to from
> another page.
> 
> I do not want it to run if the user types in the url or right clicks it.
> 
> How do I do it?

You can't.

> I think it has something to do with checking the method of post or get?

I'm in a good mood, so I'll point out that there is no way to do what
you want, and some users will have web browsers configured to prevent
what you want from working.  Ask over in comp.infosystems.www.authoring.cgi
for why; this question has nothing to do with Perl. 

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.


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

Date: Wed, 30 Apr 2003 17:13:16 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: waste of time
Message-Id: <slrnbb0ijs.58o.tadmc@magna.augustmail.com>

smugbuster <smugbuster@hotmail.com> wrote:

> your little newsgroup or whatever you call it is a waste of time for
> anybody trying to learn anything new.


Then you should quit reading it.


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


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

Date: Wed, 30 Apr 2003 22:53:48 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: waste of time
Message-Id: <0uYra.2077$XF5.782@nwrddc03.gnilink.net>

smugbuster wrote:
> your little newsgroup or whatever you call it is a waste of time for
> anybody trying to learn anything new.

Where do you see "learning" in the title of this NG?

jue




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

Date: Thu, 01 May 2003 02:11:27 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: waste of time
Message-Id: <m3wuhb1kn5.fsf@mail.goedsole.com>

Dear Y'all -

smugbuster@hotmail.com (smugbuster) writes:

> legitimate questions are disparaged, ridiculed, and made fun of.
> what's wrong with you people? you were all newbies once!

The thing you've missed is that there's an etiquette to asking.  The
reason for this protocol is to save time and effort for those who
graciously offer help to those who politely reqequest assistance.
Perhaps you should have observed how to ask before imposing on others.

> oh, also, i guess i'm not cool because i don't have a witty quip at
> the end of my message

I'm one of those who have a "witty quip" and you've inspired me to add
a new one to my collection.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

There may be no stupid questions, but there's no shortage of morons
to ask them.

		- William Goedicke


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

Date: Thu, 01 May 2003 00:12:49 +0100
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: What is AutoSearch and where do I find it?
Message-Id: <3eb05871$0$966$cc9e4d1f@news.dial.pipex.com>

Sebastien B. wrote:
> I'm trying to install WWW::Search but it keeps crapping out (see bottom).
> 
> What is this AutoSearch.PL it's looking for and where the heck do I find
> it??

    I'm just guessing here....  (I assume your have read all of the 
installation info which came with the Module?).


> /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.0/i386-linux -I/us
> r/lib/perl5/5.6.0 AutoSearch.PL AutoSearch
> Extracting AutoSearch (with variable substitutions)
> AutoSearch.PL AutoSearch
> make: AutoSearch.PL: Command not found
> make: *** [AutoSearch] Error 127

    Looks as though AutoSearch.PL is part of the distro (else perl woudl 
have complained when being asked to run it).

    SO, it looks as thouhg one of teh Makefil rules is expecting to run 
it, and it is in the current directory.

    Try appending '.' to PATH and run make again.  Perhaps the Makefiule 
rules assumes it is there (bad practice, though...)

    (and remember, this is juts a guess from the output you posted).


-- 
      -*-    Just because I've written it here doesn't    -*-
      -*-    mean that you should, or I do, believe it.   -*-



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

Date: Wed, 30 Apr 2003 17:16:31 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: What is the best software to run for an aspiring Perl programer?
Message-Id: <slrnbb0ipv.58o.tadmc@magna.augustmail.com>

dalgould <dalgould@hotmail.com> wrote:

> I have a question for anyone who may be able to answer.
> What is the best and most avaiable way of testing my perl script from
> my computer itself and not from my web server.  


Download and install perl on your computer.


> I would like to test
> my perl script locally on my computer first.  What is the best
> software to run for an aspiring Perl programer, on my home computer?


Perl.


> Im getting a little tired of uploading my perl script to my
> CGI-directory over and over just to debug my script.


You didn't tell us what kind of computer you have, so we can't
help directly with where to get a Perl that will work for you.


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


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

Date: Wed, 30 Apr 2003 22:50:55 -0400
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: What is the best software to run for an aspiring Perl programer?
Message-Id: <nY%ra.1485$nn.59295@wagner.videotron.net>

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

dalgould wrote:
> Hello,
> 
> I have a question for anyone who may be able to answer.
> What is the best and most avaiable way of testing my perl script from
> my computer itself and not from my web server.  I would like to test
> my perl script locally on my computer first.  What is the best
> software to run for an aspiring Perl programer, on my home computer?
> 
> Im getting a little tired of uploading my perl script to my
> CGI-directory over and over just to debug my script.
> 
> thank you in advance for any advice or tips!

The quick way - catches most compile-time errors:
perl -cw filename.cgi

If you're using a professional editor such as vim, you can write 
keybindings that do this for you.

The *other* answer is, simple install a web server on your computer. 
Apache runs quite nicely on both *nix and win32.

Best of luck.

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

iD8DBQE+sIuUeS99pGMif6wRAt2hAJ0b87+kJuJXeeb46XbjKdKarycnjQCgi5N7
kVid1PYGjkBalZppOpOwdCM=
=JaQi
-----END PGP SIGNATURE-----



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

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


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