[7088] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 713 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 9 07:27:14 1997

Date: Wed, 9 Jul 97 04:00:21 -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           Wed, 9 Jul 1997     Volume: 8 Number: 713

Today's topics:
     500 Server Error - Perl & Win 95 PWS (Michael Adams)
     Re: 500 Server Error - Perl & Win 95 PWS (Abigail)
     Re: Attention CGI/PERL/C++ Elite. Dream Job Offer. <pperchan@pmpcs.com>
     Re: Browser Variables (Tung-chiang Yang)
     Re: BSD-DB and tied hash problem (Paul Marquess)
     Re: Can an array have two subscripts (i.e., @array (i,j (Andrew M. Langmead)
     double cast? <petitb@space.augsburg.edu>
     Execute Perlscripts with a command string <cliff@shawfamily.com>
     Re: FDF File Problems with Text Attachment (Abigail)
     Re: GIF Control Blocks / Types in perl - unsigned, etc. (M. muPe)
     Re: How to sort an array[][]? <jhi@alpha.hut.fi>
     Interface to Ghostscript <axel@ramge.de>
     Re: Localtime in the year 2000 (Abigail)
     Need help with some code YOURLOGIN@zoo.uvm.edu
     Newbie help - Simple Guestbook Questions (ZBrett)
     Re: owner of files created by my scripts is 'nobody'... (David Bonner)
     Re: Pattern matching question <pociask@maricopa.edu>
     Re: please add this to the warning list for perl code (Abigail)
     Re: Question: Output redirection (Even Holen)
     Re: send any kinf od file to browser... (Abigail)
     Re: STDIN in Win32? (M. muPe)
     Re: Success running Calenadr on NT4.0! <ajohnson@gpu.srv.ualberta.ca>
     Wierd Angle Bracket Error <jpm@iti-oh.com>
     Re: Writing to a text file (Tung-chiang Yang)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 5 Jul 1997 22:19:00 GMT
From: msadams@netcom.com (Michael Adams)
Subject: 500 Server Error - Perl & Win 95 PWS
Message-Id: <msadamsECv9zp.FDw@netcom.com>

I have installed Perl for Win32 by ActiveWare (build 306, the latest).  
Whenever I enter the name of the Perl script to run on the Window 95 
Personal Web Server using Internet Explorer, e.g. 
http://default/Scripts/helloworld.pl, the Internet Explorer screen clears 
and gives the message "HTTP/1.0 500 Server Error".

It would appear that it is not loading the Perl script.  In fact, if I 
put even non-existent files in the address with the ".pl" extension in 
Internet Explorer, it gives the same message.  It also does this with 
".cgi" extensions.  Other extensions do not give this result, so the PWS 
does seem to be trying to do something different with Perl scripts, and 
it is not a complete failure of PWS.  It does work fine with HTML files.

I have read every FAQ for Perl and Perl with Win32, and nothing seems to 
address this.  I saw some postings on this Usenet group about changing 
the registry, and those suggestions did not work either.  There is also a 
Microsoft Knowledge base article on how to setup Perl for Win32 with IIS 
by adding an entry (".pl   c:\perl\bin\perl.exe %s %s) in the Script 
parameter for the web server.  That did not work either.

I am at a dead end.  Any help would be appreciated.

Michael Adams
-- 
                                             msadams@netcom.com


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

Date: Sun, 6 Jul 1997 00:58:42 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: 500 Server Error - Perl & Win 95 PWS
Message-Id: <ECvHDu.49o@nonexistent.com>

Michael Adams (msadams@netcom.com) wrote on 1404 September 1993 in
<URL: news:msadamsECv9zp.FDw@netcom.com>:
++ 
++ It would appear that it is not loading the Perl script.

So, it's not a Perl question. Try a more appropriate group, like
rec.pets.penguins, sci.trainspotting, comp.infosystems.www.authoring.cgi,
misc.test, comp.infosystems.www.servers.ms-windows or alt.tla.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 5 Jul 97 21:26:57 GMT
From: "Peter Perchansky" <pperchan@pmpcs.com>
Subject: Re: Attention CGI/PERL/C++ Elite. Dream Job Offer.
Message-Id: <01bc898a$26424260$c6fa2581@pmp>

Greetings:

I must be getting old...

psyboyvych@inter-nexus.com wrote in article
<5pkjpv$3tj$13@neptune.uniserve.com>...
> To the CGI/PERL/C++ Elite:
> A private organization needs your help to finnish a highly specialized
> HTML project called the "Internexus".
> The first 75 programmers who submit their name will be interviewed for
> the job.
> The people chosen will recieve shares in our Web Design company and an
> optional position as systems administrator and/or HTML author with the
> company.  Approx. $18k to start, part time.
> You will not need to relocate as the virtual office works great!
> 
> Submit you name & e-mail to the Program Director. He will contact you
> to set up an interview time.  Please do not send any of your questions
> as we will not be able to reply.  Save them for your interview:)
> Reply to texas@uniserve.com

Yes... stop charging $35 to $150 per hour to write CGI scripts and web
pages for your customers.  We will pay you $8 to $16 per hour (depending on
what's considered "part time") to be our employee.... I can see the rush of
high school and college students now.

-- 
===========================================================
Peter Perchansky,  Computer Consultant & Microsoft FrontPage MVP
PMP Computer Solutions
FrontPage Email at fp@pmpcs.com
FrontPage Web Hosting at http://www.pmpcs.com/services/fpwebhosting.htm
FrontPage Support http://www.pmpcs.com/support/frontpage.htm



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

Date: Sat, 5 Jul 1997 23:47:35 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Browser Variables
Message-Id: <tcyangECvE3C.4J6@netcom.com>

People in 'comp.infosystems.www.*' groups know.  Hope this helps :)

==============================
James Steven wrote after zapping the scum of the universe:
: Quick Question:

: I know it's possible to get the user's browser name as a variable:
: $home_ref = "http://$ENV{'SERVER_NAME'}";
: $agent = $ENV{'HTTP_USER_AGENT'};

: Is it possible to get the user's location in a variable?
: Location meaning: http://www.bob.com/whereever/tom.html

: If you know, could you please let me know.

--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: 5 Jul 1997 23:19:24 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: BSD-DB and tied hash problem
Message-Id: <5pmkps$olo$1@pheidippides.axion.bt.co.uk>

[ posted & Mailed ]

ghent@bounty-hunters.com wrote:
: I am attempting to get a very simple piece of code working:

: #!/usr/bin/perl

: use strict;
: use DB_File;
: use Fcntl;

: my (%T,%A,$item,$t,$a);

: tie %T,"DB_File","db1.db",0,0 or die $!;
: tie %A,"DB_File","db2.db",0,0 or die $!;

: foreach $item (sort keys %T) {
:         printf "$item: $T{$item} - $A{$item}\n";
: }


: The above tie()s to 2 different BSD-DB files, loops through one of them,
: and is supposed to print out matching items from both DBs.

: However, this does not work. It will print out the items in %T correctly,
: but only *some* of the corresponding %A items:

: item1: 50 - yes
: item2: 30 - no
: item3: 20 -
: item4: 70 -
: item5: 10 -
: item6: 80 -
: item7: 60 - no

: If I parse through the %A db by itself, those values are there, and show
: up properly. There does not seem to be any pattern to which items are
: displayed, but the output is the same each time.

What you are attempting should be possible. 

To be of any assistance to you, I'm going to need a few things from
you:

  1. The version of Perl you are using.
  2. The version of DB_File you have.
  3. Your operating systems name & version.
  4. Either the data from db1.db and db2.db or a self-contained script
     that illustrates the problem.

Paul


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

Date: Tue, 8 Jul 1997 18:54:27 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Can an array have two subscripts (i.e., @array (i,j))?
Message-Id: <ED0KIs.E1K@world.std.com>

Matt Roper <mattrope@mdhost.cse.tek.com> writes:

>I read somewhere that there is no built in way to do this, but you can
>trick perl into emulating this by using an associative array with keys
>such as "1,2", "4,8", etc.  I haven't tried this, but it should work.  
>Hope this helps.

The information you read is now out of date. As of perl 5 (about the
past 4 years if you include the beta releases) you can create lists of
lists. Most reasonable people will call this perl's implementation of
two dimentional arrays.

-- 
Andrew Langmead


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

Date: Tue, 08 Jul 1997 13:27:50 -0500
From: "Brent J. Petit" <petitb@space.augsburg.edu>
Subject: double cast?
Message-Id: <33C286A6.13CF6F1D@space.augsburg.edu>

I am reading bytes from a raw data file running some bitwise operations
on these values. I can't seem to find a way of casting these values as
doubles now. i.e. (double)myData.  Is there a module out there for
handling this? Or am I missing something?

Thanks,
Brent


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

Date: 8 Jul 1997 20:04:03 GMT
From: "Cliff Shaw" <cliff@shawfamily.com>
Subject: Execute Perlscripts with a command string
Message-Id: <01bc8bda$0f73a5e0$f540f6cd@cbshaw.superlink.net>

Does anyone know how I can execute another perlscript within another
perlscript, including the variables.
i.e. I run script.cgi, how do I call in that script to run
"counter.cgi?counterfilename"

Cliff Shaw
cliff@shawfamily.com


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

Date: Sun, 6 Jul 1997 00:24:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: FDF File Problems with Text Attachment
Message-Id: <ECvFs6.np@nonexistent.com>

Jared M (SBN2) (MeGuitar@usa.net) wrote on 1403 September 1993 in
<URL: news:01bc889c$0cad7020$16abaccf@miniman5>:
++                                          I am obviously not running the
++ software off of a server, and no CGI or PERL scripts would be applicable. 

Then why are you posting this in comp.lang.perl.misc?

Remind me not to take insurance from your company.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Tue, 08 Jul 1997 19:53:37 GMT
From: mupe@desk.nl (M. muPe)
Subject: Re: GIF Control Blocks / Types in perl - unsigned, etc.
Message-Id: <5pu2k3$848$1@news2.xs4all.nl>

In article <868381804.12038@dejanews.com>, kortbein@dwx.com wrote:
>This is related to a question I posted earlier, regarding pack()
>templates.
>
>I am calling pack() to create a GIF Control Block for use in me-created
>animated GIFs. Everything is working well except the delay time - the GIF
>specs call for an unsigned value, which represents the number of
>hundredths of a second to wait before displaying the next image.
>
>I pass an "S" to pack(), i.e.:
>
>$controlblock = pack("CCCCSCC",0x21,0xF9,0x04,0x00,255,0x00,0x00)
>
>The "255" is the value I'm packing into the "S".
>

I'm at the moment also into gif mixing. 
First of all note where the Graphic Control Block is placed between other
blocks. Secondly take care this block is at the right offset. 
(previous color table is correct size, and so on)
And this is what anyhow works (just like you did only a little more 
readable) ; 
  
# Graphic Control Extension block
$graphCtrE = chr(33) ;
$byte2     = chr(249) ;
$byte3     = chr(04) ;
$graphCtrE = $graphCtrE . $byte2 . $byte3 ;
$packet3   = pack("B8", "00000000") ;
$delaytime = pack("S", 00) ;
$transpar  = chr(00) ;
$end       = chr(00) ;
$graphCtrE = $graphCtrE .  $packet3 . $delaytime . $transpar . $end ;


Hope it helps,

Mathilde muPe



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

Date: 06 Jul 1997 00:45:41 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: How to sort an array[][]?
Message-Id: <oeeiuyprx4q.fsf@alpha.hut.fi>


> Let's say I've got an array like this:
>
>	$array[$x][$y]

Do you mean you have an array of array references called 'array'?

> And I want to sort it by $array[$x][0].

What do you mean by this?  Assuming that 'array' is an array of
array references the $array[$x][0] is a single element.  Sorting
'by' a single element means nothing.  You sort arrays 'by' a rule.
String, numeric, ascending, descending?

> Can I use the builtin function 'sort LIST'? 

Yes.

> And how would I do this?

By reading perlfunc on sort() and the whole of perllol.

Strictly speaking, sort() does not sort arrays.  It makes _copies_ of
arrays, sorts those copies, and returns those sorted copies.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 05 Jul 1997 18:37:14 +0200
From: Axel Ramge <axel@ramge.de>
Subject: Interface to Ghostscript
Message-Id: <m3zps18ngl.fsf@steiner.hh.ramge.de>

Hello all,

This is an interface from Perl to one single running Ghostscript
process. This is much faster (Benchmark: appr. 50%) because there is
no need to start GS once for every Postscript file, e.g. for image
conversion.

GS is tied to the calling Perl script via the IPC::open2 module and
GS's output is read via a named pipe (made with mknod) (This is all done
to prevent that windoze users will use the script ;-).

The script is working pretty fine, GS' errors are found by a forked
watchdog (because GS doesn't sends proper signals) but that is the
problem: if GS encounters an error it doesn't shut down the whole
thing.

Any help is appreciated.

Thanks

Axel

----
#!/usr/bin/perl -w
use IPC::Open2;
use File::Basename;

$DEBUG = 1;

sub gs_init {
    $thepipe = "pipe$$";
    system("mknod $thepipe p");	# Output pipe for gs
    $gs_pid = open2(\*GS_OUT, \*GS_IN, "gs -dNOPAUSE -sDEVICE=png256");
    defined($watchdog = fork) || die "fork failed: $!\n";
    if ($watchdog == 0) {	# child gs watchdog
	print STDERR "I am a child and will watch if GS makes an error.\n My pid is $$\n" if ($DEBUG);
	while (<GS_OUT>) {
	    print STDERR $_ if ($DEBUG);
	    if (/error/i) {
		print STDERR "GS (pid: $gs_pid): $_";
		unlink $thepipe;
		kill $gs_pid;
		die "GS had an error\n";
	    }
	} exit;
    } else {		# parent 
	$SIG{PIPE} = sub { die "GS or his watchdog is dead" };
    }
}

sub gs_go {
    my ($psfile) = shift;
    # set OutputFile to pipe
    print GS_IN "<</OutputFile (pipe$$)>> setpagedevice";
    # Tricky: Change from the GS> prompt to read from stdin
    print GS_IN '(%stdin) run' . "\n";
    # Pipe a whole PS file to ghostscript
    print GS_IN $psfile;
    print GS_IN "showpage\n";
    # Tricky again: Flush the OutputFile, is there something like
    # CloseOutputFile?
    print GS_IN "<</OutputFile ()>> setpagedevice\n";
    open(GS_OUTPUT,"<$thepipe");
    undef $/;
    # Read the pngfile out of the pipe
    my $out = <GS_OUTPUT>;
    close GS_OUTPUT;
    return $out;
}

print "Here I start\nI will call \"gs_init\" now\n";
gs_init();			# ... should be gs_init($gspath, $gsopt)...
foreach $file (@ARGV) {
    $pngfile = basename($file, ".ps") . ".png" ;
    undef $/;
    print STDERR "Convert $file -> $pngfile...\n" if ($DEBUG);
    open(PS,"$file") || die "No file $file";
    open(PNG,">$pngfile") || die "Bye a new hard disk!";
    print PNG gs_go(<PS>);
    close PNG;
    close PS;
}

print GS_IN "quit\n";		# ... should be sub gs_kill()...
close GS_IN;
unlink $thepipe;
print "This is the end...\n";


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

Date: Sun, 6 Jul 1997 00:31:39 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Localtime in the year 2000
Message-Id: <ECvG4r.1MC@nonexistent.com>

Morten Simonsen (mortensi@idt.ntnu.no) wrote on 1403 September 1993 in
<URL: news:5pivr5$7os@due.unit.no>:
++ 
++ I wonder what localtime will return as the year when we enter
++ the year 2000. Will it return 0 or 100?.

That depends on what kind of assembler your C compiler generates.
If it generates code such that 2000 - 1900 returns 56, localtime
will return 56.

For most people, 2000 - 1900 will return something useful, like 0x64.
But then, most people are able to read the manuals too.


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Tue, 08 Jul 1997 15:32:14 -0400
From: YOURLOGIN@zoo.uvm.edu
Subject: Need help with some code
Message-Id: <33C295BE.5C62C2BC@zoo.uvm.edu>

Hello,

I would like to know the Perl code for:

1.  Scanning a line in a file for a certain string in that line (the
line may have more stuff than just that string).

2.  Printing the rest (or the part I want) of the line other than that
string, as output.

For example, a bootstrap protocol table has lines that look like this:

dcroft     tc=.lla:        ha=00009460d24d:        ip=132.198.241.53:

I would like to search the table for a line that has the IP which
matches the user's REMOTE_ADDR.  I would then like to spit out the
"dcroft" part of that line which matches the user's REMOTE_ADDR.

Ultimately, I would like to finger the "dcroft" for the full name and
spit that as output, but the first part is the main thing...

Any help (an explanation of code for a not so smart programmer like
myself) would be greatly appreciated.  Thanks.



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

Date: 5 Jul 1997 23:13:46 GMT
From: zbrett@aol.com (ZBrett)
Subject: Newbie help - Simple Guestbook Questions
Message-Id: <19970705231300.TAA27087@ladder01.news.aol.com>

First I want to apologize if this post shows up twice on your server. 
I posted it thru my ISP yesterday and it hasn't shown up, so I thought as
an alternative I'd try AOL.

I created a real simple cgi guest book script in perl. The code for
writing the actual entries is below. THe script works great but 
Now I would like to add the html:

<a href="mailto:foo@foo.net">e mail address</a> 
and 
<ahref=http://"www.foo.net" target="_blank">web page</a>

to the script so the e mail and url links are already active. The problem 
seems to be getting the "..." (quotations) for the html to print without
perl
"seeing " them. I've been messing around with it and just can't get it
right. Any help would be greatly appreciated. Thanks.

 # Create the lock file, thereby locking the guest book
    open(LOCK,">/users/foo/.glock");
    close LOCK;

    # open and read in the old guest book
    open(GB,"</users/foo/guest.html");
    @lines = <GB>;
    close GB;

    # Expand the comments for html
    $in{'comments'} =~ s/\n/<BR>\n/go;

    # Empty the old guest book, and print it out again, adding the new
entry
    
    open(GB,">/users/foo/guest.html");
    foreach $line (@lines) {
    $line =~ s/<!--INSERT HERE-->/<!--INSERT HERE-->
      \n<P>Name: $in{'name'}<BR> 
      \nE mail:\n $in{'email'}<BR>
      \nWeb Page:\n $in{'url'}<BR>
	  \nComments:\n $in{'comments'}
      <\/P>\n<hr>\n/o;
      print GB $line;
      }
    close GB;

    # unlock the file
    unlink("/users/foo/.glock");

Also, any advice in how to  insert a line for the date and time
would be great too. Thanks.



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

Date: 5 Jul 1997 21:12:12 GMT
From: dbonner@cs.bu.edu (David Bonner)
Subject: Re: owner of files created by my scripts is 'nobody'... help
Message-Id: <5pmdbc$66k@news.bu.edu>

Francis Cebedo (francois@mtbr.com) wrote:
: I have a perl script that is executed from a web page. This script creates
: files successfully but the owner of the files is 'nobody'. This is causing
: me a lot of pain.

: Is there a way I can modify my script to avoid this? I understand this can
: be fixed on the server but I cannot control that.

You could try setting the setuid and setgid permission bits on the
script, so that it runs as you.  Typing
	chmod 6755 script.pl
should set the script to be rwx by you, and r-x by group and other.
The only problem with this is that every time you edit the script, you've
got to go back and change the permission bits again.

This should have the script run as you, and make the files belong to you.


--
------------------------------------------------------------------------
  "it's the word's suppression that gives it the power, the violence,
   the viciousness."				         -lenny bruce
------------------------------------------------------------------------
david bonner - dbonner@cs.bu.edu - http://www.cs.bu.edu/staff/TA/dbonner



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

Date: Sat, 05 Jul 1997 13:51:32 -0600
From: Jason Pociask <pociask@maricopa.edu>
Subject: Re: Pattern matching question
Message-Id: <33BEA5C4.7868@maricopa.edu>

Colin Kuskie wrote:
> 
> In article <33B75900.719E@icd.com.au>, P Nibbs  <pnibbs@icd.com.au> wrote:
> >I would like to test for IP numbers between a certain range
> >(203.63.0.0 -> 203.63.255.255)
> >
> >if ($ENV{REMOTE_ADDR} == /203.[0-63].[0-255].[0-255]/){

In addition to Colin's accurate assessment, try using "split"
to divide it up into 4 numbers, then just check using if's
for the first 2 numbers as scalars, and then the last 2 pieces
are definitely in your class B domain range.  That's probably
regex heresy but if it takes 3 pages to explain what a split
and a compound IF can do, maybe you should take the low road.

-Jason P.


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

Date: Sun, 6 Jul 1997 00:41:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: please add this to the warning list for perl code
Message-Id: <ECvGLu.2Jq@nonexistent.com>

Curtis Hrischuk (ceh@arcturus.sce.carleton.ca) wrote on 1403 September
1993 in <URL: news:wkdvi2qhmlu.fsf@arcturus.sce.carleton.ca>:
++ Hi.  Well I got bit but good by a very subtle key stroke problem.  My
++ code was:
++ 	aThing = new AThing{Data => $something};
++ 
++ See anything wrong??

No.

++ The code I really wanted has round brackets and not squiggly brackets,
++ shown below.
++ 	aThing = new AThing(Data => $something);
++ 
++ It turns out the bogus code executed properly, except the
++ initialization issued a warning about the hash having an odd number of
++ parameters.  

But the "bogus" code makes sense; at least till you run it.
{Data => $something} *is* a valid Perl expression.

++ This was so obvious that I didn't see it.
++ 
++ Would it be possible to warn about this?

Warn about what? You *got* a warning, what do you want?
A warning that Perl generated a warning?

Obviously, AThing -> new () takes a hash as argument. You give it a
ref to a hash. Perl complains.  If that isn't enough, you might want to
change Perl's source code to issue several ^G's on warnings....



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 5 Jul 1997 13:59:55 GMT
From: evenh@ra.pvv.ntnu.no (Even Holen)
Subject: Re: Question: Output redirection
Message-Id: <slrn5rskqk.s57.evenh@ra.pvv.ntnu.no>

In article <33B7D8D1.E48@ptc.com>, Sudhakar Sannakkayala wrote:
>	I'm trying to redirect the some stuff from the STDERR to a
>file. 
>Eg. example.pl >& filename
>
>This works ...
 
 This works as long as you're using (t)csh...

>   ...  But if I call "system("example.pl >& filename");" from
>another perl script it gives me an error 
>"sh: filename: Generated or received a file descriptor number that is
>not valid." 

 ... but it doesn't work when using sh. The corresponding entry in sh
is 2&>1. So that your line reads:
 system("example.pl 2&>1 filename")

>Please enligthen me 

If you want to read more on the subject then start reading the man pages
of sh ( "man sh" ) under the sections of file redirections.

Hope this helps!

Regards,
Even Holen

PS! I've set the Followup-To to comp.lang.perl.misc, since clp.modules
    and clp.tk wasn't very much related to this issue
-- 
<><   Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/   :-)


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

Date: Sun, 6 Jul 1997 00:46:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: send any kinf od file to browser...
Message-Id: <ECvGu3.31M@nonexistent.com>

Sergio Stateri Jr (serginho@alpha.hydra.com.br) wrote on 1403 September
1993 in <URL: news:01bc887d$22828580$6875e7c8@Term104>:
++ Hi! How can I send any kind of file to browser ? I know that, if I want to
++ send a gif image for a IMG tag, I'll have to send "content-type:
++ image/gif", ... But, if I don't know the kind of file ? Per example, I've
++ an array with a directory files, And I want to send any file to browser (an
++ exe, per example). How Can I do this ?


Perl is 8-bit clean. You can print anything from perl. Perl doesn't
care what kind of file you are reading, or what you are writing.  HTTP
is 8-bit clean as well. You can send anything in the body part too. No
problem. As for the appropriate HTTP headers, and the CGI interface,
please ask in comp.infosystems.www.authoring.cgi.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Sat, 05 Jul 1997 16:19:36 GMT
From: mupe@desk.nl (M. muPe)
Subject: Re: STDIN in Win32?
Message-Id: <5plou9$ef2$1@news2.xs4all.nl>

In article <33bd5401.131698@news.cei.net>, bejay1@mtnhome.com wrote:
>I've installed the latest build of Perl for Win32.  I've been working
>through the Camel book, second edition.
>
>When I run this small script, it works:
>
>print "Hello, world\n";
>print "City name? \n";
>print "\n";
>#$city = <STDIN>;
>#chomp($city);
>$city= "New York";
>if ($city eq "New York"){
>        print "New York Sucks!\n";
>}
>

What if: You don't hit enter but type something first && 
         remove $city = "New York" to make the if routine usefull.

Else you might also try to use the plain ms-dos port of Perl
for simple scripting. (Anyhow both ports are not the real unix
Perl thing, because of the OS limitation).

Mathilde muPe



  
                


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

Date: Tue, 08 Jul 1997 13:38:05 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Success running Calenadr on NT4.0!
Message-Id: <33C2890D.58EF51AD@gpu.srv.ualberta.ca>

Melody Polakow wrote:
> 

> P.S. - looking for a good ToDo List  program...

I keep meaning to write one, but I don't have a good
ToDo List program to remind me :-)

regards
andrew


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

Date: 8 Jul 1997 20:11:01 GMT
From: "Joshua Marotti" <jpm@iti-oh.com>
Subject: Wierd Angle Bracket Error
Message-Id: <01bc8bdb$0ca77110$36601ec6@bach>

I have the following chunck in my script...

while (!($params = /;/))
{
	$line = <$filehandle>
	$params = "$params $line";
}

This is supposed to handle c++ member functions that span multiple lines. 
If there is no ';' then it checks the next line, adds it to the scalar, and
continues till there is a ';'...
Well, when I run it, it checks the line, goes into the while loop, but
skips the 2nd line and goes directly to the third...  Most member functions
that span multiple lines are only 2 lines, so this causes a bit of a
problem...  Does anyone have the slightest on what maybe wrong??
There is no <$filehandle> before that would throw it either... the script
is in the correct location upon entering the while loop.
Thanks for your time,
Josh Marotti



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

Date: Sat, 5 Jul 1997 23:47:29 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Writing to a text file
Message-Id: <tcyangECvE36.4G5@netcom.com>

In addition to asking him/her to crosspost, please also ask him/her
to set Followup-To: to one group (or 'poster') only.

===========================
Tad McClellan wrote after zapping the scum of the universe:
: [
:    I see that you also posted this identical question separately
:    to the CGI newsgroup. This is the classic definition of SPAM.

:    Please do not be a spammer.

:    If you have a question that applies to more than one newsgroup,
:    (which you didn't anyway, this time) then please just
:    crosspost it instead. Then the thousands of computers around
:    the entire Earth that store news can just keep one copy on disk
:    instead of the two copies that you caused to happen by spamming.
: ]

: (deleted)

--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

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

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