[10062] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3655 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 7 20:07:10 1998

Date: Mon, 7 Sep 98 17:00:18 -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           Mon, 7 Sep 1998     Volume: 8 Number: 3655

Today's topics:
    Re: changing the default shell for system and exec comm <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Getting rid of excess file space within a file with <merlyn@stonehenge.com>
        getting the dimensions of images? <jamesht@idt.net>
        HELP NEEDED!! <uov01026@correo.uniovi.es>
    Re: How do I extract last line from multiline string? (Ronald J Kimball)
    Re: IO::File Permissions - Revisited (Ronald J Kimball)
        IO::Tac (was Re: reading a file backward) (Tim Gim Yee)
        lowercasing <wschow@Comp.HKBU.Edu.HK>
    Re: lowercasing (Mike Stok)
    Re: matching -aaaaah clue arrived <arranp@datamail.co.nz>
    Re: Newbie:  Searching French Web Pages (Ronald J Kimball)
    Re: Password checking? <ketanp@NOSPAMxwebdesign.com>
    Re: Perl & Java - differences and uses <merlyn@stonehenge.com>
    Re: Printing images (A Watcher)
        prueba <uov01026@correo.uniovi.es>
    Re: SSI Problem <samwang@freewwweb.com>
    Re: SSI Problem (Sunni Leigh)
    Re: SSI Problem <samwang@freewwweb.com>
    Re: SSI Problem <samwang@freewwweb.com>
    Re: SSI Problem (Sunni Leigh)
    Re: Why the syntax Error? Code included... <Jabok@usa.net>
    Re: Why the syntax Error? Code included... (Ronald J Kimball)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 07 Sep 1998 23:14:29 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: changing the default shell for system and exec commands
Message-Id: <35F4CB45.1585@comenius.ms.mff.cuni.cz>

Dan Nguyen wrote:
> 
> aori <aori@iil.intel.com> wrote:
> : Hi !
> : does anyone know how ??????
> : thanks Ori.
> 
> the reason the system and exec commands use sh, is that it is on every
> system.  Shells like csh, ksh, tcsh and others may or may not be on
> the sytem.
> 
> -dan
> --
>            Dan Nguyen            | There is only one happiness in
>         nguyend7@msu.edu         |   life, to love and be loved.
> http://www.cse.msu.edu/~nguyend7 |                   -George Sand

I just love these Unix-centric geeks. No, sh is not present on 
every system. Remember that Perl has been ported to Windoze, Mac, VMS
and many many others. Most of them do not have sh by default.

Jenda

BTW: No, I do not know how to change the shell. Sorry.


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

Date: Mon, 07 Sep 1998 23:42:37 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Getting rid of excess file space within a file without closing and reopening
Message-Id: <8c7lzfqylh.fsf@gadget.cscaper.com>

>>>>> "Bruce" == Bruce Smith <9401962@ml.petech.ac.za> writes:

Bruce> I am looking for some info on files and copying while locked
Bruce> with flock.  I have a file which gets parsed for lines that
Bruce> need to be deleted, and the lines which have to be kept are
Bruce> written to a temp file. Once the entire file is parsed, the
Bruce> situation is reversed and the temp file contents are copied to
Bruce> the original file. I have to use locking and the code I have
Bruce> come up with is as follows, running on a Linux 2.0.35 box and
Bruce> Perl 5.004.

Bruce> open(LOG, "+</log/death.log");
Bruce> open(TMP, "+>/tmp/death.log/tmp");
Bruce> flock(LOG, LOCK_EX);
Bruce> flock(TMP, LOCK_EX);
Bruce> while (<LOG>) {
Bruce>     if (!(m/$Test/)) {
Bruce>         print TMP "$_";
Bruce>     }
Bruce> }
Bruce> seek(LOG, 0, 0);
Bruce> seek(TMP, 0, 0);
Bruce> while (<TMP>) {
Bruce>     print LOG "$_";
Bruce> }
Bruce> close(LOG);
Bruce> close(TMP);
Bruce> unlink(TMP);

If the file is small enough, you can avoid the temp file as follows:

    open LOG, "+</log/death.log" or die "don't forget OR DIE :-) $!";
    flock LOG, 2;
    @data = grep /$Test/o, <LOG>;
    seek LOG, 0, 0;
    trunc LOG, 0; # this is the step you forgot
    print LOG @data;
    close LOG;

If it's too big to fit in memory, you can do a lot of seeks instead:

    open LOG, "+</log/death.log" or die "don't forget OR DIE :-) $!";
    flock LOG, 2;
    my $write_pos = 0;
    while (<LOG>) {
	if (/$Test/o) {
	    my $read_pos = tell LOG;
	    seek LOG, $write_pos, 0;
	    print LOG $_;
	    $write_pos = tell LOG;
	    seek LOG, $read_pos, 0;
	}
    }
    trunc LOG, $write_pos;
    close LOG;

WARNING: this works only because you've already read the data that
you'll be overwriting immediately afterwards.  You can also optimize
if you'd be writing at the place you just read, and stuff like that.

There's also the "write to tmp file and rename" approach, but you have
to be careful.  See Dejanews for "rename & flock" for me in this
group.  That way I don't have to repeat myself. :)

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Mon, 07 Sep 1998 19:12:44 -0400
From: jamesht <jamesht@idt.net>
Subject: getting the dimensions of images?
Message-Id: <35F4686C.83A10EDC@idt.net>

Hello,

I need to get the dimentions of images from a script, so I can insert
them into an html page. How would I do this?

Thank you for your help,

James Tolley
james@vansantcreations.com



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

Date: Tue, 08 Sep 1998 01:15:36 +0200
From: Roberto <uov01026@correo.uniovi.es>
Subject: HELP NEEDED!!
Message-Id: <35F46917.6D66C336@correo.uniovi.es>

Hi everybody, I'm a spanish student of Computing sciences.
I've done a perl course this summer and I have to do a project in perl.
It consists on a perl program that should make the following:
You have a given banner in a navigator window and when you click it
twice should appear other given banner in other navigator window.
As simply as this.
If any of you could help me or let me know where to found a script
that could make this I would be very grateful.
Thank you very much. :-))




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

Date: Mon, 7 Sep 1998 17:26:53 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: How do I extract last line from multiline string?
Message-Id: <1dezx1i.ch7zf41i3sgv8N@bay1-382.quincy.ziplink.net>

Stephane Barizien <NOSPAM.stephane.barizien@ocegr.fr> wrote:

> $x =~ s/\n([^\n]+)\\z//m;
> $y = $1;
> 
> and it doesn't work (don't ask me why \\z and not \z: w/ only one \
> I get a match somewhere in my string...)

That's because \z doesn't mean anything special, so it's interpolated as
simply z.  Try \Z instead.

By the way, you should assign $1 to $y only if the match actually
succeeds.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 7 Sep 1998 17:26:57 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: IO::File Permissions - Revisited
Message-Id: <1dezx4w.1q4kjwwtcv08wN@bay1-382.quincy.ziplink.net>

Bill 'Sneex' Jones <sneaker@sneex.fccj.org> wrote:

> Ronald J Kimball wrote:
> > 
> > Lack Mr G M <gml4410@ggr.co.uk> wrote:
> > >
> > 
> > That was a good call on why IO::File wasn't working as Sneex expected!
> 
> Actually, no, I had tried several incantations of this witchcraft,
> both including 0600 and "0600", I apologize for the mis-post.

I believe you missed Lack's point.  If one uses a mode of "a", as you
did, then IO::File *ignores* the permission argument and uses Perl's
built-in open function.

To make use of the permission argument, you have to use a *numeric mode*
as the second argument to IO::File::open().

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 07 Sep 1998 22:57:34 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: IO::Tac (was Re: reading a file backward)
Message-Id: <35f94f9e.274371296@news.oz.net>

On 06 Sep 1998 00:52:06 -0400, Uri Guttman <uri@sysarch.com> wrote:

>your method is good but why read the file twice? why not just scan from
>the end of the file. here is some very loose pseudo code of the proposed
>algorithm.
>
>
>on start:
>seek to end of file
>seek back 1 block size
>read in 1 block into buffer
>
>LINELOOP:
>scan buffer backwards for previous \n (rindex or regex to match last line)
>if we have a line return line
>
>if we are at seek position 0, return undef
>seek back a block, read it in, prepend to buffer
>
>next LINELOOP
>
>
>this is fast, not too hard to code and efficient. it reads only a buffer
>at a time and can work with any size file.

I have already written Mark-Jason Dominus' IO::Handle::Backwards
module awhile ago, using an algorithm like the one Uri Guttman
proposed above, but I called it IO::Tac instead.  A SYNNOPSIS might
look like this...

    use IO::Tac;

    $fh = new IO::Tac {
        Files       => [qw<file1 file2>],
        Separator   => "[\r\n]+",  # Like $/
        Regex       => 1,          # Separator is a RE
        Before      => 1,          # Append separator before line
        Size        => 8000,       # Block size to read
    };

 ...but otherwise, it is undocumented and unsupported.

>an optimization would be to read in blocks on file system block
>boundaries. the last fragment block would be read in and then previous
>blocks on their boundaries. 

Would this be implemented in C?  Can Perl find the boundaries?

>also it could use sysopen and sysread
>unless portability and other issues like handling exceptions are an
>issue (see camel p. 229-230, sysread).

Also, tell and sysread don't mix.   Though I guess you really don't
need to use tell at all.

>also as each block is read in, a list of lines positions could be
>maintained which makes the calls to readline go faster. i don't know if
>this would have any effect on the speed of reading the whole file in
>backwards. 

IO::Tac doesn't keep a record of line positions.  It just splits each
block into an array, popping the array with each readline.

>does anyone want to work with me on it to make a module out of it? i
>need more moral support than coding help, but i am willing to share the
>profits and glory! i do like the name IO::Handle::Backwards.
>it would only support <> or readline or readlines. maybe eof needs to be
>supported too.

If you find IO::Tac suitable to the task, you might not have to write
new code from scratch.  Feel free to change the module name, hack its
code, and add documentation.


package IO::Tac;

# Copyright (c) 1998 Tim Gim Yee. All rights reserved.
# This program is free software; you can redistribute it and/or modify
E it under the same terms as Perl itself.

use strict;
use Carp;
use IO::File;
use vars qw/$VERSION @ISA $AUTOLOAD %tac @chunk @files/;

$VERSION = '0.026';
@ISA     = qw/IO::File/;

sub new {
    my $this  = shift;
    my $class = ref($this) || $this;
    my $self  = new IO::Handle;
    tie *{$self}, $class, $self, @_;
}

sub TIEHANDLE {
    my $class = shift;
    my $self  = shift;
    my (%want, @files);

    if (ref $_[0]) {
        %want = %{$_[0]};
        @files = @{$want{Files}};
    } else {
        require Getopt::Std;
        local @ARGV = split ' ', "@_";
        my %opts;
        Getopt::Std::getopts('brs:', \%opts);
        my %long = qw/
            b Before
            r Regex
            s Separator
        /;
        %want = map {$long{$_}, $opts{$_}} keys %opts;
        @files = @ARGV;
    }

    $want{Separator} ||= "\n";
    $want{Separator} = quotemeta $want{Separator} if $want{Regex};
    $want{Size}  ||= 32000;
    $want{Width} ||= 0;

    for (@files ? @files : '-') {
        my $fh = new IO::File $_ or croak "Can't open $_: $!";
        binmode $fh;
        $_ = [$_, $fh];
    }

    ${*$self}{io_tac} = {
        %want,
        Files   => \@files,
        Chunk   => [],
        File    => '',
        Line    => {},
        Start	=> 1,
        End		=> 0,
    };
    bless $self, $class;
}

sub READLINE {
    my $self     = shift;
    local *tac   = \%{${*$self}{io_tac}};
    local *chunk = \@{$tac{Chunk}};
    local *files = \@{$tac{Files}};

    return unless @files;
    return reverse map {readline $_->[1]} @files if wantarray;

    $tac{File} = $files[-1][0];
    my $fh     = $files[-1][1];

    $tac{Line}{$tac{File}}++;
    $tac{Line}{''}++;

    if ($tac{Start}) {
        $tac{Start} = 0;
        seek $fh, 0, 2;
    }

    unless (@chunk) {
        my ($block, @parts);
        my $buffer = '';
        until (@parts / 2 > 1 or $tac{End}) {
            my $tell = tell $fh;
            if ($tell < $tac{Size}) {
                $tac{End}++;
                seek $fh, 0, 0;
                read $fh, $block, $tell;
            } else {
                seek $fh, -$tac{Size}, 1;
                read $fh, $block, $tac{Size};
            }
            $buffer = $block . $buffer;
            @parts = split /($tac{Separator})/o, $buffer;
            seek $fh, -$tac{Size}, 1; 
        }
        push @parts, '' if @parts % 2;
        @chunk = $tac{Before} ?
            map {$parts[2 * $_ + 1] . $parts[2 * $_]} 0..$#parts/2 :
            map {$parts[2 * $_] . $parts[2 * $_ + 1]} 0..$#parts/2 ;
        seek $fh, length shift @chunk, 1 unless $tac{End};
    }

    my $line = pop @chunk;
    if ($tac{End} && ! @chunk) {
    	pop @files;
    	$tac{Start} = 1;
    	$tac{End} = 0;
    }
    return $line;
}

sub file {
    my $self = shift;
    my $prev = ${*$self}{io_tac}{File};
    ${*$self}{io_tac}{File} = $_[0] if @_;
    $prev;
}

sub input_line_number {
    my $self = shift;
    my $prev = ${*$self}{io_tac}{Line}{''};
    ${*$self}{io_tac}{Line}{''} = $_[0] if @_;
    $prev;
}

sub line {
    my $self = shift;
    return ${*$self}{io_tac}{Line}{$self->file} unless @_;
    my $prev = ${*$self}{io_tac}{Line}{$_[0]};
    ${*$self}{io_tac}{Line}{$_[0]} = $_[1];
    $prev;
}

sub AUTOLOAD {
    local $_ = $AUTOLOAD;
    s/.*://;
    carp "Method $_() not supported by " . ref shift;
    return;
}

sub DESTROY {}

1;

__END__


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

Date: 7 Sep 1998 22:20:46 GMT
From: "Mr. Chow Wing Siu" <wschow@Comp.HKBU.Edu.HK>
Subject: lowercasing
Message-Id: <6t1m7u$enc$1@power42t.hkbu.edu.hk>



Hi, here is what I need by PERL.

THIS IS MY EXAMPLE ONE.  (Uppercase)

This Is My Example One.  (Lowercase except the first char)

Thanks.

- -- 
PGP PUBLIC KEY: https://www.comp.hkbu.edu.hk/~wschow/pgp.html
Key fingerprint = 15 C4 36 D6 EC CF 1D A4  7F D8 F9 EF 2E D7 32 A6


Version: 2.6.3i
Charset: noconv

iQCVAwUBNfRf773ixeOqBhAdAQHJygQAn9kLPX0a7t2CItHJ6Ys1hgOxbYUvKV/8
9Lmu7s1FOAb97HfqJ15753zLPgM2Gz7sf90WoqgAEed1fsvikoLY3nipmV3elBzK
0H9Z/4EiHr+wRwOiq37Fj+YgeOVhFdVK183R/mWBJ5HEd1fqVJyk1h0Sz5ImFIWV
18xry6W2nY0=
=bsZY
-----END PGP SIGNATURE-----


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

Date: 7 Sep 1998 23:00:20 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: lowercasing
Message-Id: <6t1oi4$oi6@news-central.tiac.net>

In article <6t1m7u$enc$1@power42t.hkbu.edu.hk>,
Mr. Chow Wing Siu <Johnson.Chow@Comp.HKBU.Edu.HK> wrote:

>THIS IS MY EXAMPLE ONE.  (Uppercase)
>
>This Is My Example One.  (Lowercase except the first char)

For simple definitions of "word"

  ($out = $in) =~ s/(\w+)/\u\L$1/g;

might do what you want.

If you have a recent perl installation then

  perldoc perlfaq4

should get you a more detailed explanation.  The perlop man page describes
the \u and \L escapes in the Quotes and Quotelike Operators section.

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@colltech.com                  |            Collective Technologies (work)


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

Date: Tue, 08 Sep 1998 10:33:38 +1200
From: Arran Price <arranp@datamail.co.nz>
Subject: Re: matching -aaaaah clue arrived
Message-Id: <35F45F42.5CDA@datamail.co.nz>

thanks Martien...

Martien Verbruggen wrote:
> 
> In article <35F3100C.E94@datamail.co.nz>,
>         Arran Price <arranp@datamail.co.nz> writes:
> 
> > $COUNT=0;
> > open(VALUEFILE,"transfer.txt") || warn "had a problem opening the
> > transfer.txt file\n";
> 
> This should probably die on failure, since the rest will not work
> correctly if you ignore the error like this.

yeah, I was doing a lot of debugging (which I should have stated).. you
are quite correct this should have been a die.

 
> > while (<VALUEFILE>)
> 
> >       @tablelist[$COUNT]=@myvalues[$VALCOUNT];
> 
> Hmm. Is this really what you want?
yep, that part worked very well...
 
> > open(TWENTYREP,">twenty.report");
> > open(TWENTYREP,">>twenty.report");
> 
> Why are you opening this file twice? Once clobbering it, and then
> appending to it? And you're not even checking return values.

I had to make sure that the last report was clobered as I didnt want to
append to an existing file and get duplicate entries. If there is a
better way of doing this I would love to know. Again return values I
should be checking for...

 
> open(TWENTYREP, ">twenty.report") ||
>         die "Couldn't open report for writing: $!"
yep, will be tidying up and adding more checks to my code
 
> > open(FIND,"find @ARGV[0] -name '*' -print|")||die;
> 
> You know perl has a module that does this for you, internally?
> 
> # perldoc File::Find

I do now :)
the example above is modified from something out of the camel book

> Read the perlop man page, the section on 'Regexp Quote-Like
> Operators', the entry 'm/PATTERN/cgimosx', and the explanation of the
> g modifier.

ahaaa
pos=0;
would therefore fix the problem (done, tried, worked)

> Martien


thanks again

Arran

My opinions are my own and do not reflect those of my employer.


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

Date: Mon, 7 Sep 1998 17:26:59 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Newbie:  Searching French Web Pages
Message-Id: <1dezxad.1cx97fq1hsptx4N@bay1-382.quincy.ziplink.net>

[posted and mailed]

Harley Jacoubsen <harley@dreamribbon.com> wrote:

> If I search for words like say "icole" or "modhle" I won't get any hits,
> because all instances of these words in the web pages are actually
> "&eacute;cole" and "mod&egrave;le".

Well, you either have to change your regular expressions so you're
searching for &eacute;, or change your input so it contains i.

You can do it whichever way you prefer.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 07 Sep 1998 19:02:26 -0400
From: Ketan Patel <ketanp@NOSPAMxwebdesign.com>
Subject: Re: Password checking?
Message-Id: <35F46602.7F1B504D@NOSPAMxwebdesign.com>

Eric Weiss wrote:
> A lot depends on how secure you need to make your web site.

I think we're talking about two different things...

Here is an example of what I would like to do:

1. User supplies a URL (ex: http://www.mysite.com/secure/), a username
(user), and a password (pass123) by filling out a form.

2. Script checks to see if the username/password combination is valid
for that URL by trying to access a page at that URL (by default,
http://www.mysite.com/secure/index.html)

3. If page is retrieved, the combination is added to the database,
otherwise it is rejected.

My question is about step 3... How do I perform that "verification"
step?  Do I use something from LWP?  Will it return some sort of
true/false which will essentially verify the username/password?


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

Date: Mon, 07 Sep 1998 23:48:16 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <8c3ea3qyc3.fsf@gadget.cscaper.com>

>>>>> "bjohnsto" == bjohnsto usa net <bjohnsto_usa_net@dejanews.com> writes:

bjohnsto> On the Web server.

bjohnsto> On the web server you can execute a Perl script, or a Java
bjohnsto> Sevlet (There are plenty of nonstandard solutions: if you
bjohnsto> use AOL server you could use a TCL script and with
bjohnsto> Microsoft's IIS you could use an ASP page).

bjohnsto> These scripts could do some processing like putting an order
bjohnsto> into a database, then generate a page to show the results.
bjohnsto> Perl is better than Java at manipulating text.  So Perl is
bjohnsto> mostly better for this job.  To help get around Java's
bjohnsto> weakness with Text Sun has introduced jhtml pages which help
bjohnsto> somewhat.  Perl has much less need for help here.

You've also forgotten the way-cool "mod_perl" that permits Perl
"Servlets" (ugh, what a name) under Apache (the dominant Web server on
the net, and gaining market share).  This isn't just souped up CGI...
Perl through mod_perl has access to the entire Apache API, and can do
everything from creating a custom logging record into a database all
the way to translating URLs into database calls depending on the time
of day.

bjohnsto> On the Browser

bjohnsto> On the web browser Java has a full built-in graphical
bjohnsto> environment in a secure sand box.  Java's competition here
bjohnsto> is JavaScript, an unrelated language which fits into the
bjohnsto> HTML environment rather than having its own GUI.  Perl is
bjohnsto> not wide spread enough amongst clients to be useful.

And Java is disabled enough on serious surfers to not be useful
either.  I'll never surf the wide-open net-seas with Java or
Javascript enabled.

bjohnsto> In the Database

bjohnsto> Java is being added to the existing proprietary programming
bjohnsto> languages available for storing logic to run inside
bjohnsto> databases.  Java's competitors include PL/SQL, TransactSQL
bjohnsto> and other proprietary languages.  In the database Perl is
bjohnsto> again not supported here.

Tim Bunce and the thousands of users of DBI/DBD would probably
disagree with you here. :)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Mon, 07 Sep 1998 23:45:57 GMT
From: dodge@aloha.net (A Watcher)
Subject: Re: Printing images
Message-Id: <35f87032.2484483@news.aloha.net>

On 07 Sep 1998 09:08:34 +0200, Tony Curtis
<Tony.Curtis+usenet@vcpc.univie.ac.at> wrote:

>Re: Printing images, A <dodge@aloha.net> said:
>
>A> Hi, Is there a simple way to print three small gif files
>A> on the outsides of hidden named fields?
>
>[html snipped]
>
>  I tried img src="name1.gif"
>
>That's the way to do it (as Mr. Punch would say).
>
Does not work.  The gif files are printed to a html page where several
separate tables are generated in response to customer input.   The
paragraph text comes out OK, where I need these image files for
clarification but;  the program hangs when I access the program on the
apache server,   perl 5, when I add the images.  

Thanks again.



 The more I know, the more I know -- I don't know.

                    {:>)=  

            http://www.spiced.com        


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

Date: Tue, 08 Sep 1998 01:12:21 +0200
From: Roberto <uov01026@correo.uniovi.es>
Subject: prueba
Message-Id: <35F46854.318FD574@correo.uniovi.es>

hola



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

Date: Mon, 07 Sep 1998 15:37:09 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: SSI Problem
Message-Id: <35F443F5.97C95E1@freewwweb.com>

might want to try <!--#exec cgi="/cgi-bin/poll.cgi" -->

(added slash in front of uri)



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

Date: Mon, 07 Sep 1998 14:29:55 +0000
From: Funkybiz@aol.com (Sunni Leigh)
Subject: Re: SSI Problem
Message-Id: <Funkybiz-ya02408000R0709981429550001@news.wco.com>

In article <35F443F5.97C95E1@freewwweb.com>, Sam Wang
<samwang@freewwweb.com> wrote:

> might want to try <!--#exec cgi="/cgi-bin/poll.cgi" -->
> 
> (added slash in front of uri)

I have tried that....I have tried everything that is why I am so confused,
I have tried a variety of paths trying to get this thing to work and it is
driving me crazy.

See it works if you type in this url
http://www.wco.com/~mikepix/cgi-bin/poll.cgi
but if you try to get there from here
http://www.wco.com/~mikepix/jenssurveysays/addpoll3.cgi
It just gives you that error, I can't seem to find the right path to embed
it on my page.
Thanks again for any help anyone can give.
Sunni


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

Date: Mon, 07 Sep 1998 16:44:54 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: SSI Problem
Message-Id: <35F453D5.865D0FF3@freewwweb.com>

how about <!--#exec cmd="perl /cgi-bin/poll.cgi"-->
if that doesn't work then chances are your ipp doesn't support SSI exec (many
don't).

Sunni Leigh wrote:

> In article <35F443F5.97C95E1@freewwweb.com>, Sam Wang
> <samwang@freewwweb.com> wrote:
>
> > might want to try <!--#exec cgi="/cgi-bin/poll.cgi" -->
> >
> > (added slash in front of uri)
>
> I have tried that....I have tried everything that is why I am so confused,
> I have tried a variety of paths trying to get this thing to work and it is
> driving me crazy.
>
> See it works if you type in this url
> http://www.wco.com/~mikepix/cgi-bin/poll.cgi
> but if you try to get there from here
> http://www.wco.com/~mikepix/jenssurveysays/addpoll3.cgi
> It just gives you that error, I can't seem to find the right path to embed
> it on my page.
> Thanks again for any help anyone can give.
> Sunni
>



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

Date: Mon, 07 Sep 1998 16:53:44 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: SSI Problem
Message-Id: <35F455E8.DEACE048@freewwweb.com>

come to think of it, there is a way to execute a perl prog even if your IPP bans
#exec.
just create a blank gif file. upload it. then make your cgi script's only output
as "Content-type: image/gif\n\n" and then the contents of the blank image. (i
believe you can use open(), then a read(), then print the contents of the
buffer).

then in your html doc, put <IMG src="NAME_OF_YOUR_SCRIPT_.pl">

i suppose the only flaw is that you can put out any output, but i THINK you might
be able to do that with SSI #include.

Sam Wang wrote:


> how about <!--#exec cmd="perl /cgi-bin/poll.cgi"-->
> if that doesn't work then chances are your ipp doesn't support SSI exec (many
> don't).



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

Date: Mon, 07 Sep 1998 16:35:52 +0000
From: Funkybiz@aol.com (Sunni Leigh)
Subject: Re: SSI Problem
Message-Id: <Funkybiz-ya02408000R0709981635520001@news.wco.com>

I think mine might allow it, when I type in help exec on telnet it gives me this
bash-2.01$ help exec
exec: exec [-cl] [-a name] file [redirection ...]
    Exec FILE, replacing this shell with the specified program.
    If FILE is not specified, the redirections take effect in this
    shell.  If the first argument is `-l', then place a dash in the
    zeroth arg passed to FILE, as login does.  If the `-c' option
    is supplied, FILE is executed with a null environment.  The `-a'
    option means to make set argv[0] of the executed process to NAME.
    If the file cannot be executed and the shell is not interactive,
    then the shell exits, unless the shell option `execfail' is set.
Thanks sunni


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

Date: Mon, 07 Sep 1998 21:15:46 GMT
From: "Jabok" <Jabok@usa.net>
Subject: Re: Why the syntax Error? Code included...
Message-Id: <62YI1.26$95.203251@news.goodnet.com>


Jabok wrote in message ...

>Sub derivehead


>sub loadpath


Sorry for the post I figured it out ?-) I capitalized sub

Jabok




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

Date: Mon, 7 Sep 1998 17:27:00 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Why the syntax Error? Code included...
Message-Id: <1dezxn8.4v85pzs4yt9jN@bay1-382.quincy.ziplink.net>

[posted and mailed]

Jabok <Jabok@usa.net> wrote:

> Sub derivehead
  ^^^

Should be sub, all lowercase.

> {
>  local($template_file, $template_path, $template_base) = @_;
>   print "$template_path/$template_file";                       #syntax error

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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