[17724] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5144 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 18 18:15:43 2000

Date: Mon, 18 Dec 2000 15:15:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977181321-v9-i5144@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 18 Dec 2000     Volume: 9 Number: 5144

Today's topics:
    Re: Simple filehandle question - Please help. msalerno@my-deja.com
    Re: Simple filehandle question - Please help. (Tad McClellan)
    Re: Simple filehandle question - Please help. <ruben@www2.mrbrklyn.com>
    Re: Simple filehandle question - Please help. <ruben@www2.mrbrklyn.com>
    Re: Simple filehandle question - Please help. <ruben@www2.mrbrklyn.com>
        simulatenous db queries using DBI (DBD::mysql) <amir142@my-deja.com>
        Splitting record string into fields appsman1368@my-deja.com
    Re: Splitting record string into fields (Tad McClellan)
        substrings - // question <cleon42@my-deja.com>
        substrings - // question <cleon42@my-deja.com>
    Re: substrings - // question (Richard Zilavec)
        Substrings <cleon42@my-deja.com>
    Re: Substrings (Scott Zsori)
        temporary files <me@privacy.net>
    Re: time, schedules, advice <jbuff1856@my-deja.com>
    Re: time, schedules, advice <ng@fnmail.com>
    Re: Upload Image don't refresh (Richard Zilavec)
        Using Quota? <seppy@chartermi.net>
        variables in html files <me@privacy.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 18 Dec 2000 19:56:11 GMT
From: msalerno@my-deja.com
Subject: Re: Simple filehandle question - Please help.
Message-Id: <91lq4n$7hj$1@nnrp1.deja.com>

In article <u9itohipdh.fsf@wcl-l.bham.ac.uk>,
  nobull@mail.com wrote:
> msalerno@my-deja.com writes:
>
> > I have written a script that:
> > 1. opens a file
> > 2. searches the file
> > 3. backs up the file
> > 4. writes over the old file
>
> Perhaps you should show us the script - this is what you _want_ the
> script to do but presumably you wouldn't be posting if the script was
> working.
>
> > It seems that the open filehandle gets closed when the script leaves
the
> > subroutine.
>
> Can you show us some evidence to support is assertion.
>
> --
>      \\   ( )
>   .  _\\__[oo
>  .__/  \\ /\@
>  .  l___\\
>   # ll  l\\
>  ###LL  LL\\
>


Here is the script.  There has got to be something that I am missing.
Also, please keep in mind that I am pretty new at this.  The names of
the files have been changed to passwd3 to protect the innocent.  Thanks
for the assistance.

Matt

#!/usr/bin/perl -w

use strict;
use Shell('cp');
use vars qw($o $user $pword $uid $gid $comment $home $shell $initials);

my $default_pass = "Testing123";
my $backup_dir = "/usr/bak";
my $bin = "/home/admin/bin";
my $passwd = "/etc/passwd";
my $whoami = $<;
my $revision = 0;

PASSWD:
die "\nERROR: the backup directory $backup_dir does not exist!\n" unless
( -d $backup_dir );
die "\nERROR: $passwd is not a regular file, or does not exist\n" unless
( -f $passwd );

#die "\nERROR: You must be root in order to run this script\n\n" unless
$whoami == 0;

my($day, $mon, $year) = (localtime)[3..5];$mon+=1;$year+=1900;
my $today = sprintf "%02d%02d%4d",$mon,$day,$year;

#system ("clear");
print "##########################################################
# WARNING : This script makes changes to the /etc/passwd #
# file.  Do not use this script unless you understand    #
# what you are doing.                                    #
##########################################################\n\n";
print "$mon\/$day\/$year\n";

print "Enter your Initials\n\n-(Initials)-> ";
chomp(my $initials = <STDIN>);
die "\nInvalid Input\n\n" unless length($initials) > 1;

QUERY:
print "\nEnter the user information that you want to search for\nType Q
to exit\n\n-(Query)-> ";
chomp(my $search =  <STDIN> );
print "\n";
die "\n" unless length($search) > 1;
die "Bye !\n" if $search =~  /^q\b/i;

FILENAME:
$revision++;
goto FILENAME while ( -e
"$backup_dir\/passwd.$today.$initials.$revision");
my $backupfile = "$backup_dir\/passwd.$today.$initials.$revision";

cp('/etc/passwd3', $backupfile);
open(PASSWD, "<$backupfile") || die "can't open /etc/passwd3\n";

my $test = pwsearch($search);

sub pwsearch {
	my @pwq = <PASSWD>;
	my $cnt = 0;
		for (my $i= 0; $i < @pwq; $i++)
		{

		if (lc($pwq[$i]) =~ /\Q$search/ ){
		my($user, $pword, $uid, $gid, $comment, $home, $shell) = split(/:/,
$pwq[$i]);
		$cnt++;
		$o = $i;
		print "User: $user\tComments: $comment\n";
						}
		}

	if ($cnt < 1){
		print "No Users found with current search criteria - \"$search\"\n";
		goto QUERY;
		}
	if ($cnt > 1){
		print "\n$cnt users found who match the search criteria \nPlease
refine your search or look at the above list for the user\n\n";
		goto QUERY;
		}
	return $cnt;
	}

#my $test = pwsearch($search);
print " - $test\n";


my %updates = ($search => $default_pass);

# IF I UNCOMMENT THIS LINE IT WORKS !!!!!!!!!
#open(PASSWD, "<$backupfile") || die "can't open /etc/passwd3\n";

open(OUTFILE, ">/tmp/passwd3") || die "Can't write /etc/passwd3\n";

while (<PASSWD>) {
my @fields = split /:/;
$fields[1] =  $updates{$fields[0]} || $fields[1];
print OUTFILE join ':', @fields;
}


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 14:55:43 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Simple filehandle question - Please help.
Message-Id: <slrn93sqtv.6qn.tadmc@magna.metronet.com>


[ You should leave the pleading out of your Subject header.
  It is a red flag that says "don't read me"...
]


msalerno@my-deja.com <msalerno@my-deja.com> wrote:
>I have written a script that:
>1. opens a file
>2. searches the file
>3. backs up the file
>4. writes over the old file
>
>For the search function I am using a subroutine.  When the script enters
>the sub I put the file into an array and search it.  The only thing that
>I return from the sub is the amount of times that the search matches.
>It seems that the open filehandle gets closed when the script leaves the
>subroutine.  


No it doesn't.


>I don't want to have to reopen the file.


Why not?

It is usually more expedient than the alternative (particularly
when you are unaware of the alternative).


>Please let me know
>if there is anything that I can try.


   perldoc -f seek


>open(PASSWD, "<$backupfile") || die "can't open /etc/passwd\n";
>
>sub pwsearch {
>        my @pwq = <PASSWD>;
                   ^^^^^^^^

The input operator is in list context there. In list context it
reads *all* of the lines, right up to end-of-file.


>	---Search Stuff---
>	}
>my $test = pwsearch($search);
>while (<PASSWD>) {


The file is still open, but it is at EOF, so you don't read anything.


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


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

Date: Mon, 18 Dec 2000 22:32:36 GMT
From: "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
Subject: Re: Simple filehandle question - Please help.
Message-Id: <8gw%5.105699$IP1.3514504@news1.giganews.com>

I'm trying to make head or tails of what you wrote here.

Are you using the same Filehandle for reading the file and the backup.
that would do it.

Put your subroutine at the end of the file and make it easier to read.

Ruben
http://www.mrbrklyn.com
http://www.wynn.com/jewish/perl_course

In article <91lk9r$23t$1@nnrp1.deja.com>, msalerno@my-deja.com wrote:

> I have written a script that:
> 1. opens a file
> 2. searches the file
> 3. backs up the file
> 4. writes over the old file
> 
> For the search function I am using a subroutine.  When the script enters
> the sub I put the file into an array and search it.  The only thing that
> I return from the sub is the amount of times that the search matches. It
> seems that the open filehandle gets closed when the script leaves the
> subroutine.  The filehandle is opened before the subroutine is called.
> If I comment out the line that calls the sub, everything is passed along
> just fine.  I don't want to have to reopen the file.  Please let me know
> if there is anything that I can try.
> 
> Thanks,
> 
> Matt
> 
> ex.
> 
> open(PASSWD, "<$backupfile") || die "can't open /etc/passwd\n";
> 
> sub pwsearch {
>         my @pwq = <PASSWD>;
> 	---Search Stuff---
> 	}
> my $test = pwsearch($search); while (<PASSWD>) { print OUTFILE $foo;
> 
> 
> Sent via Deja.com http://www.deja.com/


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

Date: Mon, 18 Dec 2000 22:39:40 GMT
From: "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
Subject: Re: Simple filehandle question - Please help.
Message-Id: <Mmw%5.146987$DG3.2937300@news2.giganews.com>

In article <91lh98$v65$1@nnrp1.deja.com>, msalerno@my-deja.com wrote:

You want something like this, but check the syntax, I often make syntax
errors...

 

     1  #!/usr/bin/perl -w
      2 
      3 
      4 open IN, "</etc/passwd" or die;
      5 open OUT, ">/tmp/backup" or die;
      6 
      7 @passwd = <IN>;
      8 
      9 &searchme(@passwd);
     10 
     11 print OUT @passwd;
     12 close(IN);
     13 open OUT2, ">/etc/passwd";
     14 print OUT2 @passwd;
     15 
     16 
     17 
     18 
     19            
> I have written a script that:
> 1. opens a file
> 2. searches the file
> 3. backs up the file
> 4. writes over the old file
> 
> For the search function I am using a subroutine.  When the script enters
> the sub I put the file into an array and search it.  The only thing that
> I return from the sub is the amount of times that the search matches. It
> seems that the open filehandle gets closed when the script leaves the
> subroutine.  The filehandle is opened before the subroutine is called.
> If I comment out the line that calls the sub, everything is passed along
> just fine.  I don't want to have to reopen the file.  Please let me know
> if there is anything that I can try.
> 
> Thanks,
> 
> Matt
> 
> ex.
> 
> open(PASSWD, "<$backupfile") || die "can't open /etc/passwd\n";
> 
> sub pwsearch {
>         my @pwq = <PASSWD>;
> 	---Search Stuff---
> 	}
> my $test = pwsearch($search); while (<PASSWD>) { print OUTFILE $foo;
> 
> 
> Sent via Deja.com http://www.deja.com/


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

Date: Mon, 18 Dec 2000 22:42:13 GMT
From: "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
Subject: Re: Simple filehandle question - Please help.
Message-Id: <9pw%5.146998$DG3.2937300@news2.giganews.com>

Why are you sticking Labels in space like that?

Ruben


In article <91lq4n$7hj$1@nnrp1.deja.com>, msalerno@my-deja.com wrote:

> In article <u9itohipdh.fsf@wcl-l.bham.ac.uk>,
>   nobull@mail.com wrote:
>> msalerno@my-deja.com writes:
>>
>> > I have written a script that:
>> > 1. opens a file
>> > 2. searches the file
>> > 3. backs up the file
>> > 4. writes over the old file
>>
>> Perhaps you should show us the script - this is what you _want_ the
>> script to do but presumably you wouldn't be posting if the script was
>> working.
>>
>> > It seems that the open filehandle gets closed when the script leaves
> the
>> > subroutine.
>>
>> Can you show us some evidence to support is assertion.
>>
>> --
>>      \\   ( )
>>   .  _\\__[oo
>>  .__/  \\ /\@
>>  .  l___\\
>>   # ll  l\\
>>  ###LL  LL\\
>>
> 
> 
> Here is the script.  There has got to be something that I am missing.
> Also, please keep in mind that I am pretty new at this.  The names of
> the files have been changed to passwd3 to protect the innocent.  Thanks
> for the assistance.
> 
> Matt
> 
> #!/usr/bin/perl -w
> 
> use strict; use Shell('cp'); use vars qw($o $user $pword $uid $gid
> $comment $home $shell $initials);
> 
> my $default_pass = "Testing123"; my $backup_dir = "/usr/bak"; my $bin =
> "/home/admin/bin"; my $passwd = "/etc/passwd"; my $whoami = $<; my
> $revision = 0;
> 
> PASSWD: die "\nERROR: the backup directory $backup_dir does not
> exist!\n" unless
> ( -d $backup_dir );
> die "\nERROR: $passwd is not a regular file, or does not exist\n" unless
> ( -f $passwd );
> 
> #die "\nERROR: You must be root in order to run this script\n\n" unless
> $whoami == 0;
> 
> my($day, $mon, $year) = (localtime)[3..5];$mon+=1;$year+=1900; my $today
> = sprintf "%02d%02d%4d",$mon,$day,$year;
> 
> #system ("clear");
> print "##########################################################
> # WARNING : This script makes changes to the /etc/passwd #
> # file.  Do not use this script unless you understand    #
> # what you are doing.                                    #
> ##########################################################\n\n";
> print "$mon\/$day\/$year\n";
> 
> print "Enter your Initials\n\n-(Initials)-> "; chomp(my $initials =
> <STDIN>); die "\nInvalid Input\n\n" unless length($initials) > 1;
> 
> QUERY: print "\nEnter the user information that you want to search
> for\nType Q to exit\n\n-(Query)-> "; chomp(my $search =  <STDIN> );
> print "\n"; die "\n" unless length($search) > 1; die "Bye !\n" if
> $search =~  /^q\b/i;
> 
> FILENAME:
> $revision++;
> goto FILENAME while ( -e
> "$backup_dir\/passwd.$today.$initials.$revision");
> my $backupfile = "$backup_dir\/passwd.$today.$initials.$revision";
> 
> cp('/etc/passwd3', $backupfile); open(PASSWD, "<$backupfile") || die
> "can't open /etc/passwd3\n";
> 
> my $test = pwsearch($search);
> 
> sub pwsearch {
> 	my @pwq = <PASSWD>; my $cnt = 0;
> 		for (my $i= 0; $i < @pwq; $i++)
> 		{
> 
> 		if (lc($pwq[$i]) =~ /\Q$search/ ){ my($user, $pword, $uid, $gid,
> 		$comment, $home, $shell) = split(/:/,
> $pwq[$i]);
> 		$cnt++;
> 		$o = $i;
> 		print "User: $user\tComments: $comment\n";
> 						}
> 		}
> 
> 	if ($cnt < 1){
> 		print "No Users found with current search criteria - \"$search\"\n";
> 		goto QUERY;
> 		}
> 	if ($cnt > 1){
> 		print "\n$cnt users found who match the search criteria \nPlease
> refine your search or look at the above list for the user\n\n";
> 		goto QUERY;
> 		}
> 	return $cnt;
> 	}
> 
> #my $test = pwsearch($search);
> print " - $test\n";
> 
> 
> my %updates = ($search => $default_pass);
> 
> # IF I UNCOMMENT THIS LINE IT WORKS !!!!!!!!!
> #open(PASSWD, "<$backupfile") || die "can't open /etc/passwd3\n";
> 
> open(OUTFILE, ">/tmp/passwd3") || die "Can't write /etc/passwd3\n";
> 
> while (<PASSWD>) { my @fields = split /:/;
> $fields[1] =  $updates{$fields[0]} || $fields[1];
> print OUTFILE join ':', @fields;
> }
> 
> 
> Sent via Deja.com http://www.deja.com/


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

Date: Mon, 18 Dec 2000 21:33:21 GMT
From: Amir Malik <amir142@my-deja.com>
Subject: simulatenous db queries using DBI (DBD::mysql)
Message-Id: <91lvr0$cm8$1@nnrp1.deja.com>

I am writing a chat server in perl (using select() non-blocking I/O)
and was wondering if it is possible have one connection to the db
($dbh) and make it possible to do simultaneous queries?

So can you simultaneously do $dbh->do($query)? I will be only do()ing
INSERTs and UPDATEs.

Secondly, is it possible to share one database handle and do prepare()s
and execute()s and fetchrow()s? and have clients simultaneously do
these?

I think that the do() thing can be done, since you're not fetching any
rows, just executing a query, right?

What about individual, simultaneous SELECTs?

Thanks,
Amir


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 20:27:58 GMT
From: appsman1368@my-deja.com
Subject: Splitting record string into fields
Message-Id: <91ls05$98c$1@nnrp1.deja.com>

I have a database output of 20,000+ records, each record comprising
fixed-length fields - making each record about 1500 characters long.

I need to convert this output into csv fields - anyone know of a ready-made
perl script I could use. I really don't have the time to learn perl at the
moment but I am assured that it is the best tool available.

Thanks in advance


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 15:04:27 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Splitting record string into fields
Message-Id: <slrn93sreb.6sn.tadmc@magna.metronet.com>

appsman1368@my-deja.com <appsman1368@my-deja.com> wrote:

>I really don't have the time to learn perl at the
>moment but I am assured that it is the best tool available.


Then hire someone who _has_ taken the time to learn Perl.


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


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

Date: Mon, 18 Dec 2000 19:42:19 GMT
From: Adam Levenstein <cleon42@my-deja.com>
Subject: substrings - // question
Message-Id: <91lpap$6ke$1@nnrp1.deja.com>

Hey all,

Here's the line, read from a file:

USER:username

followed by a newline, and the username is of varying lengths. I'm
trying to get the username and put it into $user. Here's the line I've
been using, but doesn't seem to work:

$user = "VALUE=\"" . ($data[3] =~ /USER:\S{1,}\n$/) . "\"";

The goal here is to make $user equal

VALUE="username", for an HTML input field.

Exactly where am I going wrong with the above?

Thanks,

Adam

--
-------------------------------------------------
Adam Levenstein
cleon42@my-deja.com

"Extraordinary claims require extraordinary evidence."
				-- Carl Sagan


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 19:46:43 GMT
From: Adam Levenstein <cleon42@my-deja.com>
Subject: substrings - // question
Message-Id: <91lpj0$70d$1@nnrp1.deja.com>

Hey all,

Here's the line, read from a file:

USER:username

followed by a newline, and the username is of varying lengths. I'm
trying to get the username and put it into $user. Here's the line I've
been using, but doesn't seem to work:

$user = "VALUE=\"" . ($data[3] =~ /USER:\S{1,}\n$/) . "\"";

The goal here is to make $user equal

VALUE="username", for an HTML input field.

Exactly where am I going wrong with the above?

Thanks,

Adam

--
-------------------------------------------------
Adam Levenstein
cleon42@my-deja.com

"Extraordinary claims require extraordinary evidence."
				-- Carl Sagan


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 20:52:04 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: substrings - // question
Message-Id: <3a3e76c1.5413288@news.tcn.net>

On Mon, 18 Dec 2000 19:42:19 GMT, Adam Levenstein
<cleon42@my-deja.com> wrote:

>USER:username

You should use split here perldoc -f split

while(<READ>) {
	chomp;
	my $username = (split(/:/, $_)[1];
	
>$user = "VALUE=\"" . ($data[3] =~ /USER:\S{1,}\n$/) . "\"";
                                   ^^^^^^ 
Using qq{} might make the above line easier to read..
	my $user = qq{VALUE="$username"};

	print $user . "\n";

Hope this helps...


--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Mon, 18 Dec 2000 20:25:09 GMT
From: Adam Levenstein <cleon42@my-deja.com>
Subject: Substrings
Message-Id: <91lrqs$8u0$1@nnrp1.deja.com>

Hey all,

Here's the line, read from a file:

USER:username

followed by a newline, and the username is of varying lengths. I'm
trying to get the username and put it into $user. Here's the line I've
been using, but doesn't seem to work:

$user = "VALUE=\"" . ($data[3] =~ /USER:\S{1,}\n$/) . "\"";

The goal here is to make $user equal

VALUE="username", for an HTML input field.

Exactly where am I going wrong with the above?

Thanks,

Adam


--
-------------------------------------------------
Adam Levenstein
cleon42@my-deja.com

"Extraordinary claims require extraordinary evidence."
				-- Carl Sagan


Sent via Deja.com
http://www.deja.com/


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

Date: 18 Dec 2000 22:21:06 GMT
From: newsgroup@nathigh.com (Scott Zsori)
Subject: Re: Substrings
Message-Id: <3a3e8dd2$0$75805$272ea4a1@news.execpc.com>

>Here's the line, read from a file:
>
>USER:username
>
>followed by a newline, and the username is of varying lengths. I'm
>trying to get the username and put it into $user. Here's the line I've
>been using, but doesn't seem to work:
>
>$user = "VALUE=\"" . ($data[3] =~ /USER:\S{1,}\n$/) . "\"";
>
>The goal here is to make $user equal
>
>VALUE="username", for an HTML input field.
>
>Exactly where am I going wrong with the above?

I would do it this way:
$data[3] =~ /USER:\s*(.*?)\n/;
$user = "VALUE=\"$1\"";

But I tend to use more lines than necessary.  :)

Scott Zsori
http://www.nathigh.com


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

Date: Mon, 18 Dec 2000 21:44:22 GMT
From: "EM" <me@privacy.net>
Subject: temporary files
Message-Id: <Wyv%5.9854$Nw6.32408@news.iol.ie>

how do i save a file to the memory/disk where that when the script
terminates any temporary files are automatically deleted

------------
Eric




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

Date: Mon, 18 Dec 2000 21:32:22 GMT
From: jbuff <jbuff1856@my-deja.com>
Subject: Re: time, schedules, advice
Message-Id: <91lvp6$ckg$1@nnrp1.deja.com>

In article <91k90k$jm0$1@info1.fnal.gov>,
  "Enrico Ng" <ng@fnmail.com> wrote:
> I am making a webpage for alocal tv station.
> I would like some advice on the schedule system.
> I want to be able to display the schedule by calling a function that
takes
> two(or three) arguments, date,time, duration.
> and have it display a grid (table) with the times and the shows.
>

Tread carefully, someone actually has a patent on displaying TV
schedules in a grid with time on one axis. Silly, but true.

The owner of the patent is quite litigious, and you could find yourself
enjoined, or be required to pay a royalty.

--jbuff


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 18 Dec 2000 16:32:18 -0600
From: "Enrico Ng" <ng@fnmail.com>
Subject: Re: time, schedules, advice
Message-Id: <91m3ab$k43$1@info1.fnal.gov>

actually this is a webpage for the tvstation of my university
the page would only be accessable to those in the university domain

also I would only plan on storing the schedule about two-three week in
advanced
so maybe I can do something where I dont store a date, just a time offset of
some sort.
I dont know, I'm looking for some advice on how to store a date or a number
that represtents the date and time.
since when the data is stored, it will be a begin time and duration, i need
an easy way to add times

--
Enrico Ng <ng@fnmail.com>
"jbuff" <jbuff1856@my-deja.com> wrote in message
news:91lvp6$ckg$1@nnrp1.deja.com...
> In article <91k90k$jm0$1@info1.fnal.gov>,
>   "Enrico Ng" <ng@fnmail.com> wrote:
> > I am making a webpage for alocal tv station.
> > I would like some advice on the schedule system.
> > I want to be able to display the schedule by calling a function that
> takes
> > two(or three) arguments, date,time, duration.
> > and have it display a grid (table) with the times and the shows.
> >
>
> Tread carefully, someone actually has a patent on displaying TV
> schedules in a grid with time on one axis. Silly, but true.
>
> The owner of the patent is quite litigious, and you could find yourself
> enjoined, or be required to pay a royalty.
>
> --jbuff
>
>
> Sent via Deja.com
> http://www.deja.com/




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

Date: Mon, 18 Dec 2000 19:53:46 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: Upload Image don't refresh
Message-Id: <3a3e6907.1899245@news.tcn.net>

On Mon, 18 Dec 2000 03:47:57 GMT, martinnitram@excite.com wrote:

>Dear all,
>    I used the CGI.pm to upload the image and it done successfully. But
>if let user to re-submit the form and the saving file name is the same
>(say, hardcord the image name as tmp.gif), when use <img src=tmp.gif>
>to show the image, it always keep to show first one uploaded. I had
>tried to use http-expire for both HTML and CHI-header to force the page
>expire but still no effect. Any one had suggestion to solve this
>problem? (apert from use another cgi to read and write the content)
>

Write a script to load the images...

<img src="http://someplace.com/picture.pl?pict=some.jpg">


$| = 1;
print "Content-type: image/jpeg\n";
print <<EOF;
Pragma: no-cache
Expires: Fri, 01 Jan 1983 00:00:00 GMT

EOF
open(FILE, "< $in{'pic'}") || warn "Can't open $in{'pic'}: $!\n";
while(<FILE>) { print; }
close(FILE);

You might have to put a random number too, so
pict=some.jpg&num=123499...


--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Mon, 18 Dec 2000 14:16:52 -0500
From: "Brian E. Seppanen" <seppy@chartermi.net>
Subject: Using Quota?
Message-Id: <3A3E62A4.DC6342D6@chartermi.net>

I'm trying to use the quota perl module and it looks pretty
straightforward, however, I'm a total beginner.  

I'm trying to do the following straight from the command line and I get
the following error.
Use of uninitialized value at ./quota_check line 6

The following is what I have.

#!/usr/bin/perl -w

use Quota;

$block_curr=Quota::query(sda6,9550);
print "$block_curr\n";

exit 0

According to the perldoc the following are the variables it will return
for quota::query
	 use Quota;

         ($block_curr, $block_soft, $block_hard, $block_timelimit,
          $inode_curr, $inode_soft, $inode_hard, $inode_timelimit) =
          Quota::query($dev [,$uid]);

Obviously I'm missing something very fundamental.  Can someone shed some
light on what I'm missing?

Thanks, 
Brian Seppanen
Charter Communications				
Regional Data Center				906-228-4226 ext 23
Marquette, MI					seppy@chartermi.net


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

Date: Mon, 18 Dec 2000 21:39:32 GMT
From: "EM" <me@privacy.net>
Subject: variables in html files
Message-Id: <ouv%5.9853$Nw6.32471@news.iol.ie>

i am making a script and using html templates
the problem is that the html file will contain variables such as
<html><body><b>$text</b></body></html>
but when perl opens the html and prints it to the screen it does not
translate $text
how do i get this to work?

-------------
Eric




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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 5144
**************************************


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