[6721] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 345 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 22 17:18:20 1997

Date: Tue, 22 Apr 97 14:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 22 Apr 1997     Volume: 8 Number: 345

Today's topics:
     Re: cgi security - how to protect data from local cgi-s (Andreas Karrer)
     Re: Change password in /etc/shadow via script <rootbeer@teleport.com>
     Re: FAQ's --BUSTED-- (M.J.T. Guy)
     Re: getgrid() undefined <rootbeer@teleport.com>
     Getting image size <willem@ozartnet.com.au>
     Re: Getting image size (Mike Stok)
     Re: Getting image size (Nathan V. Patwardhan)
     Re: Help..Perl Script For Byte Counter <rootbeer@teleport.com>
     Re: HELP:  Redirection with Perl... (Scott)
     Re: How to expand a variable in a string? (Petr Prikryl)
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th (David Fox)
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th (Matthew D. Healy)
     need short script to replace txt file without fefreshin <otto@htp.net>
     Re: Oraperl (Mike Stok)
     Re: Ousterhout and Tcl lost the plot with latest paper <ludemann@inxight.com>
     Re: Perl -e switch <tim@atldev.com>
     Re: PERL Editor (Kyzer)
     Re: perl NOT enabled???? win95 - MS server... Please he (Kyzer)
     Re: perl NOT enabled???? win95 - MS server... Please he (Nathan V. Patwardhan)
     Re: Perl script keeps coming up in Wordpad; why???????? (Matthew D. Healy)
     Re: Reading data from a file <rootbeer@teleport.com>
     Re: Reading this will take seconds! (Tad McClellan)
     Re: Regular expression with Hex code <dbenhur@egames.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 22 Apr 1997 19:02:36 GMT
From: karrer@ife.ee.ethz.ch (Andreas Karrer)
Subject: Re: cgi security - how to protect data from local cgi-server shell users?
Message-Id: <slrn5lq2qd.161.karrer@kuru.ee.ethz.ch>

In article <861385348.13692@dejanews.com>, Ron Elkayam wrote:

>  We're running a cgi form and the contents are stored on the cgi-server
>  shell account.  Is there a way to hide the contents of the cgi script
>  itself so local shell users won't be able to simply look at the file,
>  figure out where the data files are, and mess up the data?
>
>  I *must* give everyone both read and execute permissions on the cgi
>  script, and write permission on the actual data files.  I could hide
>  the data files in an unreadable directory, but again, anyone with a
>  cgi-account here could still read the cgi script and find out where the
>  data is...

>From your description I would assume that a user "with a cgi-account"
is one that can place CGI scripts in some directory where the http server
expects them. But the server runs all those scripts under the same
UID (perhaps "nobody") regardless who wrote or owns the scripts.

This seems like a less-than-optimal setup.

cgiwrap (ftp://ftp.cc.umr.edu/pub/cgi/cgiwrap/) runs CGIs under the
UID of the owner. For your problem, creating a user that owns the
CGI and the data files, but nothing else; and running the CGI under
control of cgiwrap is a possible solution.

F'up set to comp.infosystems.www.authoring.cgi, where this sort of
problem belongs.

 - Andi


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

Date: Mon, 21 Apr 1997 10:40:06 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Geoff Mottram <minaret@sprynet.com>
Subject: Re: Change password in /etc/shadow via script
Message-Id: <Pine.GSO.3.96.970421103825.917E-100000@kelly.teleport.com>

On 17 Apr 1997, Geoff Mottram wrote:

> After you prompt the user for their name, old password and new password,
> set up a pipe to the "passwd" program.  You will provide the user name
> as an argument to "passwd" and then use the pipe to feed it the old and
> new passwords.  Run "passwd" by hand to see what it expects. 

Have you actually tried this? I don't think it will work on most systems. 
(passwd usually doesn't use standard input, unless I'm mistaken.) What
systems have you been able to make it work on?

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 22 Apr 1997 18:08:12 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: FAQ's --BUSTED--
Message-Id: <5jiuqc$12s@lyra.csx.cam.ac.uk>

In article <335479ea.5950997@nntp.netcruiser>,
Brian Lavender <brian@brie.com> wrote:
>I just posted a message about this and I will hopefully repost  it
>more clearly. Go to 
>
>:http://www.perl.com/perl/faq/
>
>If you select the link "html format" from the following list you will
>find it leads you to the large document of the faq's. 
>
>:As one large document in the following formats: 
>:          pod format 
>:          man format 
>:          html format 
>
>This document contains the faq questions at the top. Unfortunately if
>you select one of the question links such as below you will find that
>instead of leading you to the answer it leads you to the main man page
>for perl.

It isn't busted for me.  It seems to be performing exactly as described
in the rubric:

   The FAQ is available in a variety of forms:
     * As individual HTML pages, here or on a CPAN mirror.
     * As one large document in the following formats:
          + pod format
          + man format
          + html format
          + postscript format
          + plaintext format (nearly)

The "here" link and the "CPAN mirror" link get you an index for the
individual questions; the other links point to one large document.
Just like it says.


Mike Guy


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

Date: Mon, 21 Apr 1997 10:37:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: THIAM YEO <n1835173@sparrow.qut.edu.au>
Subject: Re: getgrid() undefined
Message-Id: <Pine.GSO.3.96.970421102856.917D-100000@kelly.teleport.com>

On Fri, 18 Apr 1997, THIAM YEO wrote:

>   PERL is complaining that the subroutine getgrid() is undefined. 

Been trying to learn Perl in 21 days, perhaps? :-)  

There's a popular book (some would say _too_ popular :-) which purports to
teach Perl, but among its many errors is that it talks about the 'getgrid'
function, which of course should be 'getgrgid'.

I had heard that this book was full of errors, but I didn't think it could
be as bad as all that. Then I got a look at a copy. I flipped it open at
random, and the very first page I saw had a serious error right at the
top. (It had the parameters to symlink backwards, if I recall correctly.) 

I didn't look any further, so I can state that 100% of the pages I've seen
in that book were erroneous. :-) 

Might I recommend the Camel and Llama books? Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 23 Apr 1997 04:47:16 +1000
From: Willem van den Bosch <willem@ozartnet.com.au>
Subject: Getting image size
Message-Id: <335D07B3.81786A50@ozartnet.com.au>


Hi All

Is there anyway of getting the image size in pixels from a gif or jpeg
file, using perl. If the answer is yes Please tell me how.

Regards willem
-- 
+--Willem van den Bosch ---------------------------------------+
|  OzArtNet                                                    |
|  Australian Art On-Line       http://www.ozartnet.com.au     |
+--Phone: +61 7 5533 5260 ----- Fax: +61 7 5533 5371 ----------+


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

Date: 22 Apr 1997 19:51:35 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Getting image size
Message-Id: <5jj4s7$qj@news-central.tiac.net>

In article <335D07B3.81786A50@ozartnet.com.au>,
Willem van den Bosch  <willem@ozartnet.com.au> wrote:

>Is there anyway of getting the image size in pixels from a gif or jpeg
>file, using perl. If the answer is yes Please tell me how.

If you're using perl 5 then

  ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/00modlist.long.html

(or the mirror under the sites at:

Australasia

    Australia       ftp://ftp.netinfo.com.au/pub/perl/CPAN/
    New Zealand     ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/

which might give better performance for you...)

contains this which contains the Image::Size module:

18) Images, Pixmap and Bitmap Manipulation, Drawing and Graphing

Name           DSLI  Description                                  Info
-----------    ----  -------------------------------------------- -----

[...]

Image::
::ColorSpace   id    transform colors between colorspaces         JONO
::Magick       RdcO  Read, query, transform, and write images     JCRISTY+
::Size         Rdpf  Measure size of images in common formats     RJRAY

and the readme for Image::Size says:

Image::Size has pod documentation that gives a more complete overview, but
in a nutshell:

        use Image::Size;

        ($x, $y) = imgsize("something.gif");

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 22 Apr 1997 19:51:32 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Getting image size
Message-Id: <5jj4s4$dar@fridge-nf0.shore.net>

Willem van den Bosch (willem@ozartnet.com.au) wrote:

: Is there anyway of getting the image size in pixels from a gif or jpeg
: file, using perl. If the answer is yes Please tell me how.

Yes.  Get the Image::Size module from a CPAN near you!
http://www.perl.com/CPAN/modules/by-module/Image/

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Mon, 21 Apr 1997 10:43:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Deepak Thadani <deepak@pcsltd.com>
Subject: Re: Help..Perl Script For Byte Counter
Message-Id: <Pine.GSO.3.96.970421104218.917F-100000@kelly.teleport.com>

On Thu, 17 Apr 1997, Deepak Thadani wrote:

> 	I was wondering if anyone knew of a cool way to display a 
> number in the same location of the screen using a perl script?

Sounds like you want the Curses module. 

> PS: we're using Perl 4.035 right now.

Sounds like you want to install a newer version of Perl first. You'll find
what you need on CPAN. Hope this helps!

    http://www.perl.com/CPAN/
    http://www.perl.org/CPAN/

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Tue, 22 Apr 1997 18:17:39 GMT
From: seligman@netcom.com (Scott)
Subject: Re: HELP:  Redirection with Perl...
Message-Id: <seligmanE91xHG.Gzn@netcom.com>


In article <5jipgj$mb7@info.abdn.ac.uk>, Kyzer <dev.null> wrote:
> $foo="the pike";
>   print <<"EOFISH";
> My email address is <a href="mailto:me\@home.net">me\@home.net</a>
> I charge $5 for unsolicited mail. My favourite fish is $foo.
> EOFISH

You need to escape the $5, thusly:

$foo="the pike";
  print <<"EOFISH";
My email address is <a href="mailto:me\@home.net">me\@home.net</a>
I charge \$5 for unsolicited mail. My favourite fish is $foo.
EOFISH


-- 
-- Scott Seligman                        will hack perl for good books
-- email: seligman@netcom.com


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

Date: 22 Apr 1997 12:43:42 GMT
From: prikryl@dcse.fee.vutbr.cz (Petr Prikryl)
Subject: Re: How to expand a variable in a string?
Message-Id: <5jibpu$ae1$1@boco.fee.vutbr.cz>

Status: SOLVED    ;-)

Thank you for solving the problem. I am going to summarize the answer
to the question. I have got three kinds of answers (also by e-mail).
The first one does not solve my problem -- like this one.

David Alan Black (dblack@icarus.shu.edu) wrote:
>prikryl@dcse.fee.vutbr.cz (Petr Prikryl) writes:
>>I have read a string into my variable $str. The string may be something
>>like this:
>>           "some text $variable and some text again"
[...]
>>How can I expand the string while replacing the
>>substring "$variable" by the content of the $variable?
>>I mean, when:   $variable = "HELLO";
>>then the string will be "some text HELLO and some text again" after.
>>I expect this to be fairly easy, I just have no idea :-|

>It's very easy.  You have no idea how easy it is....
>Just run your code and watch the magic :-)

Thank you, David (and others), for willing to help, but if it was
that easy, I would not ask. Maybe, I could emphasize the fact that
the string was read from a file, therefore the "$variable" could not
be interpolated. You can simulate this by assignment:

  $str = 'some text $variable and some text again';

And only now I want to solve the problem.

I like the answer of Bill (he knows his name ;-)
---------------------------------------------------------
The basic method is to use eval to do the interpolation of $variable
inside another variable.  For example,

  $str = 'some text $variable and some text again';  #-- un-interpolated
  $variable = "HELLO";
  $code_fragment = '$str_expanded = ' . "\"$str\";";
  print "Code:", $code_fragment, "\n";
  eval($code_fragment) or die;
  print "Expanded Value:", $str_expanded, "\n";

produces:

  Code:$str_expanded = "some text $variable and some text again";
  Expanded Value:some text HELLO and some text again

Please forgive quick, messy example; I am sure someone has a much
cleaner way to write the line for $code_fragment.
---------------------------------------------------------

This was what I wanted to know but I could not get it working
because I had no experience with eval(). I did not want to ask
about eval() in the original question, because I did not want
to restrict the solution to eval(). And yes, there is much
nicer solution (just in the spirit of "There's more than one
way to do it")

Bill wrote later...
---------------------------------------------------------
In my previous response (building code fragment and eval() function), I
assumed you wanted more than simple interpolation. That is, you were
looking for more than the simple situation:

    $str = "some text $variable and some text again";

which does interpolation as part of processing doubly quoted string.

For another options, Deja News also had news thread that discussed using
regular expression such as:

  $str = 'some text $variable and some text again';  #-- un-interpolated
  #....time passes
  $variable = "HELLO";
  print '$Str before:', $str, "\n";
  $str =~ s/(\$\w+)/$1/ee;
  print '$Str after:', $str, "\n";

to produce:

  $Str before:some text $variable and some text again
  $Str after:some text HELLO and some text again
Be sure to include /ee on regular expression in order to evaluate the
expression found in the replacement.
----------------------------------------------------------

I seemed strange to me to use /ee in s///, but I found it also
in perlop(1) in examples for s///:
--------------------------------------------------------
   # /e's can even nest;  this will expand
   # simple embedded variables in $_
   s/(\$\w+)/$1/eeg; 
--------------------------------------------------------

Finally, it happened that I will use the solution of Tad McClellan
from this thread:
--------------------------------------------
  $str =~ s/\$variable/$variable/;   #  ;-)
--------------------------------------------

This is not so general like the previous case, but it is perfect
for me because I would like to restrict the replacement only for
some variables.

Than to all of you again, and long live to NetNews :-)

Petr

--
Petr Prikryl (prikryl@dcse.fee.vutbr.cz)   http://www.fee.vutbr.cz/~prikryl/
TU of Brno, Dept. of Computer Sci. & Engineering;    tel. +420-(0)5-7275 218


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

Date: 22 Apr 1997 07:45:50 -0400
From: fox@c a t . n y u . e d u (David Fox)
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <y5ad8rnnuvl.fsf@graphics.cat.nyu.edu>

In article <l2lo6d9i98.fsf@safran.kurims.kyoto-u.ac.jp> Jacques GARRIGUE <garrigue@safran.kurims.kyoto-u.ac.jp> writes:

] Let's see a small example:
] 
] (TCL)
] button .b -text Hello -font {Times 12} -relief sunken
] 
] (LablTk)
] let b = Button.create parent:top text:"Hello" font:"Times 12" relief:`Sunken
] 
] Again, the syntax is not more difficult. Allegedly a little bit more
] verbose, but not really bothering. The difference is that everything
] that can be checked is checked at compile time (or even before, using
] the interactive editor):

I've been pondering this issue of scripting vs. programming, and the
two communities they represent.  I think this example captures the
conflict pretty well.  To someone writing a script, the subtle control
and data structures are just extraneous and annoying: Create?  Of
course, what else?  Parent:top?  Who cares?  The difference between
the two examples is small in terms of the amount of text, but to the
script writer the additions are just annoying.  Its like having to
write "and" between each entry in your grocery shopping list.

The scripting community will always be much larger than the
programming community, but you can't have one without the other.  So
there is no point to getting the world to stop using simple languages.
No offense, but its a little like trying to teach a pig to sing.  Its
a waste of time and it annoys the pig.
-- 
David Fox            http://www.cat.nyu.edu/fox            xoF divaD
NYU Media Research Lab     fox@cat.nyu.edu    baL hcraeseR aideM UYN


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

Date: Tue, 22 Apr 1997 16:24:42 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <Matthew.Healy-2204971624420001@pudding.med.yale.edu>

In article <5jgvh0$rj6@pravda.cc.gatech.edu>, lyman@cc.gatech.edu (Lyman
S. Taylor) wrote:

> 
>    To futher supplement that "it was the marketing.... " viewpoint, 
>    BusinessWeek has an article this week about how the Alpha is both the 
>    fastest general purpose microprocessor out. And the one with the smallest 
>    market share. 
> 
>         http://www.businessweek.com/1997/17/b3524142.htm
> 

Yup.  I read this in the printed version of {Business Week} during my
lunch break today.

One especially interesting detail: _APPLE_ approached DEC about using
Alphas for their next generation of Macs, but DEC wasn't interested,
so they went the PowerPC route.

Apple's having their share of problems these days, mostly because their
long-standing tradition of shooting themselves repeatedly in both feet
finally caught up with them, so AlphMacs might not have saved them
from themselves, but wouldn't they have been _nifty_ boxes!

For of all sad words of tongue or pen,
The saddest are these: "It might have been!" 
-John Greenleaf Whittier

If, of all the words of tongue and pen, 
The saddest are, "It might have been,'' 
More sad are these we daily see: 
"It is, but hadn't ought to be.'' 
- Bret Harte
---------
As of 19 Apr 1997, 986 days till Y2K....
Matthew.Healy@yale.edu
http://paella.med.yale.edu/~healy
"But I thought it was pointed at the rabbit *between* my feet!"
---------
Help a victim of severe email harrassment, see
http://www.geocities.com/~hitchcockc/story.html#fund
---------


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

Date: 22 Apr 1997 18:34:34 GMT
From: "Otto F. Bauer" <otto@htp.net>
Subject: need short script to replace txt file without fefreshing screen
Message-Id: <01bc4f4d$f13b4240$7f04abc7@ottob.li.net>

I'm new at this yet but with a little script that takes a get from html one
text field and submit and writes the variable to a .txt file with out
refreshing the html page at all.
needs to be simple and complete with html.
thanks,
          otto@how-2.com


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

Date: 22 Apr 1997 20:01:10 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Oraperl
Message-Id: <5jj5e6$1eo@news-central.tiac.net>

In article <5jgmu0$r6i@prometheus.acsu.buffalo.edu>,
Rick B Teh <boonteh@acsu.buffalo.edu> wrote:
>Hi...
>
>I know both Oracal and Perl, but have no knowledge in using oraperl.
>Can anyone please give me some sort of guide line for a newbie like 
>me? I need to at least get myself started. Thanks in advance.

Oraperl is a special perl 4.xxx binary with the oracle libraries linked
into it, if you have any choice in the matter you migth try getting a
recent perl 5 and use the DBI (database interface) module and the oracle
DBD (database driver) modules.

The DBI and DBD stuff is documented at
http://www.hermetica.com/technologia/perl/DBI/

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 22 Apr 1997 12:47:28 -0700
From: Peter Ludemann <ludemann@inxight.com>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <wuj20822627.fsf@wistaria.i-have-a-misconfigured-system-so-shoot-me>

jamesl@netcom.com (James Logajan) writes:

> NOTE TO LISP AND FORTH FANS: one important reason your languages
> have never caught on may be due to the fact that many natural languages
> follow the "subject verb object" form. Usage of SOV, OSV, VSO, and VOS
> are less likely 
[snip]

So, FORTH should be extremely popular in Japan, because Japanese is
very much SOV.

And your theory doesn't account for the popularity of the WIMP
interface, which is basically OV (select object, select action).

(A nice theory shot down by dirty facts.)

-- 
Peter Ludemann		+1.415.813.6806  (fax: +1.415.813.7499)
Software Architect	ludemann@inxight.com
InXight Software, Inc.	http://www.inxight.com
PAHV 105, 3400 Hillview Ave., Palo Alto, CA 94304 


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

Date: Tue, 22 Apr 1997 14:22:38 -0400
From: Tim Shelling <tim@atldev.com>
To: Chris Andrew <earl@bell.us>
Subject: Re: Perl -e switch
Message-Id: <335D01EE.4069@atldev.com>

Chris Andrew wrote:
> Now I want to move the perl statement to the shell script in a "sort-of"
> here-statement as follows:
> 
> perl -e `print join (' ', sort split(' ', $ARGV[0])), "\n";' "$arr"

Right, but there are too many "tics". Try replacing the ' ' inside
the join and split each with " ".

You could also pass the *name* of the environment variable "arr"
and have perl use that directly, as in:

join(" ", sort split(" ", $ENV{$ARGV[0]} ) )

-- 
Tim Shelling               | tim@atldev.com | 404-628-3301 
Atlanta Development Center | 2675 Paces Ferry Rd NW, Ste. 130, Atlanta,
GA 30339
 "An atheist is a man who has no invisible means of support." - John
Buchan


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

Date: 22 Apr 1997 17:58:54 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: PERL Editor
Message-Id: <5jiu8u$mb7@info.abdn.ac.uk>

Dick Barker of dickb@eskimo.com wrote in comp.lang.perl.misc:
: Real perl programmers use cat >fname to write their stuff.
Actually they use emacs.pl :)

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
BONUS: Present this .sig at Tesco for a 15% discount.


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

Date: 22 Apr 1997 18:44:19 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: perl NOT enabled???? win95 - MS server... Please help
Message-Id: <5jj0u3$rgr@info.abdn.ac.uk>

Jody of Webmaster@urdls.com wrote in comp.lang.perl.misc:
: I'm trying to get a simple search engine to work with a dynamic IP server (mine)
: Is there a program I have to install in the cgi-bin/scripts folder?

perl.exe :)

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
"Cows can vary in length by up to one metre" - Open University


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

Date: 22 Apr 1997 19:00:41 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: perl NOT enabled???? win95 - MS server... Please help
Message-Id: <5jj1sp$a7e@fridge-nf0.shore.net>


Kyzer (junkmail@sysa.abdn.ac.uk) wrote:

: : Is there a program I have to install in the cgi-bin/scripts folder?
: perl.exe :)

Umm, no.  NEVER put perl.exe in the /cgi-bin directory.  Create 
associations; edit the registry; install Linux, but don't put perl.exe
there.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Tue, 22 Apr 1997 14:58:46 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: Perl script keeps coming up in Wordpad; why????????
Message-Id: <Matthew.Healy-2204971458460001@pudding.med.yale.edu>

In article <33565E4E.18F@primenet.com>, John Carruthers
<topcat1@primenet.com> wrote:

>   Can anyone tell me please what is happening.  When my HTML script
> calls my Perl program, the program is brought up in WordPad.  WHY
> ???????????

This is not a Perl question, it is a CGI question.  You should
ask such questions in a newsgroup dedicated to CGI programming.
You should also state which OS and which webserver when you do
ask your question in the appropriate newsgroup.

However, BEFORE asking again, you should talk to YOUR WEBMASTER,
because the exact answer will depend not only on your webserver
and OS, but also on how YOUR WEBMASTER has configured your system,
which means this specific question can ONLY be answered by YOUR
WEBMASTER.

In general terms, the behavior you describe means that the webserver
does not know this file is a CGI script.  Not only must it have the
appropriate OS-level permissions, but also the webserver must be told
to execute it as a script; there are various ways this can be done.

However, most webmasters INTENTIONALLY configure things in such a way
that you CANNOT create CGI scripts without FIRST talking to your webmaster.
This is because a clueless user who installs a CGI script without first
talking to the webmaster can easily create serious problems for the entire
server.

If YOUR WEBMASTER cannot help you, then your only option is probably to
find yourself a different webserver.
---------
As of 19 Apr 1997, 986 days till Y2K....
Matthew.Healy@yale.edu
http://paella.med.yale.edu/~healy
"But I thought it was pointed at the rabbit *between* my feet!"
---------
Help a victim of severe email harrassment, see
http://www.geocities.com/~hitchcockc/story.html#fund
---------


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

Date: Mon, 21 Apr 1997 11:17:12 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Julia L. Bell" <bellju@zeus.jpl.nasa.gov>
Subject: Re: Reading data from a file
Message-Id: <Pine.GSO.3.96.970421111234.917J-100000@kelly.teleport.com>

On 17 Apr 1997, Julia L. Bell wrote:

> A1: while ($line = <IN>) {
>     if ($line =~ /SUMMARY PRINT/) {
>         print "Found Block\n";
>         last A1;
>     }
> }
> # Start reading a processing data from the correct data block
>    ...
> 
> This is very inefficient since it requires that I read and search through
> almost 97% of the file until I find what I want.
> 
> OPTION 1:
> Is there a way to have perl start reading lines from the end of a file
> and go backwards?

No; reads (by themselves) always go forwards.

> OPTION 2:
> I can determine a prior (using grep -n) which line of the file the block
> starts on.  Could I use that information in perl to by-pass the beginning
> of the file and only start reading from line X?  That would even be a better
> option than reading backwards.

You can use seek(), but you can't give it a line number. If your file
doesn't change between sessions, you might try saving the information from
tell(), which should be faster than starting a grep process anyway. Hope
this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Tue, 22 Apr 1997 10:05:10 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Reading this will take seconds!
Message-Id: <63kij5.kb2.ln@localhost>

Nathan V. Patwardhan (nvp@shore.net) wrote:
: Sly@yournamehere.com wrote:

: : Thanks for your time.  We at I.S.P.O.T. (The International Society
: : for the Preservation Of Trees (URL http://www.local-touch.com/ISPOT/)) feel
: : that electronic messages are great for getting the word out while preserving
: : our friend the tree.  Anyway, please stop by our home page!

: How about the "International Society for the Preservation of Bandwidth?"  :-)


s/Bandwidth/Assholes/;    # I *really* dislike spammers...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Tue, 22 Apr 1997 11:18:24 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Cheng Tyh Lin <a00lcj00@elc012.nchc.gov.tw>
Subject: Re: Regular expression with Hex code
Message-Id: <335D00F0.1B0@egames.com>

[mail&post]
Cheng Tyh Lin wrote:
>   There are two strings as below. I am try to open a file, search for
> whether the file content the following $a string(in hex, E0 stands for \xE0).
> If it exists, substitute $a with $b.
>     $a = "E0003D00E1002B00E7002A00E300";
>     $b = "a=b+c*d";
> 
> (1) Which is the most convenient way to implement this job?

$pat = pack('H*', $a); # convert to chars
undef $/;       # no record seperator
$_ = <STDIN>;   # so, shlurp whole file
s/\Q$pat/$b/g;  # replace strings
print;          # print it

> (2) Do I need to open this file in binmode?(This file is an executable
>     file produced by C++ language)

yes, though it shouldn't matter under un*x.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"No, I'm not going to explain it. If you can't figure it out, 
 you didn't want to know anyway..." --Larry Wall



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 345
*************************************

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