[18435] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 603 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 2 21:16:21 2001

Date: Mon, 2 Apr 2001 18:15:55 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <986260554-v10-i603@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 2 Apr 2001     Volume: 10 Number: 603

Today's topics:
        help needed with Best-fit algorithm <akurczyn@hotmail.com>
    Re: help needed with Best-fit algorithm (Logan Shaw)
    Re: help needed with Best-fit algorithm <joe+usenet@sunstarsys.com>
    Re: help needed with Best-fit algorithm <gtoomey@usa.net>
    Re: help needed with Best-fit algorithm <rick.delaney@home.com>
        help page refresh runs the script again ! <root@novastar.dtds.net>
    Re: Help with CGI scripts <webmaster@webdragon.unmunge.net>
    Re: Help with CGI scripts <wayne.keenan@ntlworld.com>
        help with modifying files <xzrgpnys@yvtugubhfrovm.pbz>
    Re: help with modifying files (Logan Shaw)
        HELP: need simple replacement for IPC::Run run() functi (Michael Friendly)
        Histograms? <bcoon@sequenom.com>
        HmacSHA1 for perl and java <jkekoni@cc.hut.fi>
        how do you pass 2 hash to a sub <afshin.akbari@sympatico.ca>
    Re: how to access HTML pages with username and password <"al<NoSpam>sorrell"@yahoo.com>
    Re: How to create " Who is OnLine " page ? <peter@venturenet.co.za>
        how to delete files? <marc.beck@bigfoot.com>
    Re: how to delete files? (Jay Tilton)
    Re: How to do this in perl ? (Abigail)
        How to matching multiple patterns in a string in any or <unknown@spammesenseless.com>
    Re: How to matching multiple patterns in a string in an (Garry Williams)
    Re: How to use Net::SMTP through a firewall (proxy)? (Chris Fedde)
    Re: howto detect safeperl <wayne.keenan@ntlworld.com>
    Re: HUP signal handling <goldbb2@earthlink.net>
        Image Reloading Problem <bcoon@sequenom.com>
    Re: Image Reloading Problem <caryz@hotmail.com>
        keep configurations in central place <bing-du@tamu.edu>
    Re: keep configurations in central place <wayne.keenan@ntlworld.com>
    Re: keep configurations in central place <comdog@panix.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 30 Mar 2001 23:01:00 -0600
From: "Alejandro Kurczyn" <akurczyn@hotmail.com>
Subject: help needed with Best-fit algorithm
Message-Id: <3ac56379@excalibur.gbmtech.net>

Hello all, I'm tying to solve this puzzle for weeks:

Given a collection of files, and a max. capacity of storage media (e.g. CD),
how to compute the best-fit mix of files to store leaving zero bytes free on
each CD?

I'm sure it has to be an optimal (mean fast and simple) solution to this,
but I can't manage to figure it out. BTW, selecting all big files first and
the "filling-up" with smaller ones does not work, since maybe taking out a
big file and adding two or more smaller files will give a better result. I'm
sure this involves recursivity somehow...

Any tips or solutions will be greatly appreciated!

Thanks!
-Alejandro K.




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

Date: 30 Mar 2001 23:45:06 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: help needed with Best-fit algorithm
Message-Id: <9a3qt2$fe7$1@boomer.cs.utexas.edu>

In article <3ac56379@excalibur.gbmtech.net>,
Alejandro Kurczyn <akurczyn@hotmail.com> wrote:
>Hello all, I'm tying to solve this puzzle for weeks:
>
>Given a collection of files, and a max. capacity of storage media (e.g. CD),
>how to compute the best-fit mix of files to store leaving zero bytes free on
>each CD?
>
>I'm sure it has to be an optimal (mean fast and simple) solution to this,
>but I can't manage to figure it out. BTW, selecting all big files first and
>the "filling-up" with smaller ones does not work, since maybe taking out a
>big file and adding two or more smaller files will give a better result. I'm
>sure this involves recursivity somehow...

Congratulations!  You have discovered a problem that computer
scientists call the bin packing problem.

Computer scientists love to figure out great ways to solve this
problem.  There are tons of approaches.

The simplest way to get the optimal solution is to try all possible
combinations.  That's not feasible in most cases.  Actually, I believe
that for many of the variations of the problem, it has been proven that
trying all combinations is the *only* way to be sure to find the
optimal solution.

So, you pretty much have to resort to some algorithm that is going to
give you an answer that is not quite optimal but close.  The one you
gave -- trying to fit the largest objects in first -- is a pretty good
one, and definitely the easiest to understand.

I used to know a good solution for the special case that your numbers
are relatively small integers.  I wish I could remember it.  It used
dynamic programming, which is a lot like doing recursion backwards.

I wish I could provide some links to some good web sites about the bin
packing problem, but I can't seem to find any.  I suppose you could try
checking the comp.theory FAQ.

  - Logan
-- 
whose?  my  your   his  her   our   their   _its_
who's?  I'm you're he's she's we're they're _it's_


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

Date: 31 Mar 2001 02:02:46 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: help needed with Best-fit algorithm
Message-Id: <m3ae627755.fsf@mumonkan.sunstarsys.com>

"Gregory Toomey" <gtoomey@usa.net> writes:

> The best bet is to use an approximate algorithm (or heuristic).
> a) Select a random series of file sizes that make up less than 650MB (the
> size of 1 CD).
> b) Run a) lots of times (say 10,000)
> c) Of the 10,000 solutions pick the best one.
> 

If you're going to recommend a heuristic solution, you might
as well recommend a good one.  It's quite possible that none
of the (say 10,000) randomly selected series of files will
form a solution, much less an optimal one.

I found some decent links at 

  google (one dimensional bin packing)

Many articles reference a procedure (MTP) listed in

    S. Martello and P. Toth, _Knapsack problems_. Wiley (1990)

That might be a good place to start.

-- 
Joe Schaefer       "The man who sets out to carry a cat by its tail learns
                something that will always be useful and which never will grow
                                      dim or doubtful."
                                               --Mark Twain


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

Date: Sat, 31 Mar 2001 18:35:38 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: help needed with Best-fit algorithm
Message-Id: <Msgx6.6456$45.37612@newsfeeds.bigpond.com>


"Joe Schaefer" <joe+usenet@sunstarsys.com> wrote in message
news:m3ae627755.fsf@mumonkan.sunstarsys.com...
> If you're going to recommend a heuristic solution, you might
> as well recommend a good one.  It's quite possible that none
> of the (say 10,000) randomly selected series of files will
> form a solution, much less an optimal one.

The algorithm is simple:

set total to 0;
{Select a file at random
add to to the total}
(repeat while the total<650M)


I was not saying "select ANY random subset of files, nomatter what they sum
to".

gtoomey





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

Date: Sat, 31 Mar 2001 05:37:24 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: help needed with Best-fit algorithm
Message-Id: <3AC57051.EF8822FB@home.com>

[posted & mailed]

Alejandro Kurczyn wrote:
> 
> Hello all, I'm tying to solve this puzzle for weeks:

It could take a lot longer than that.

> Given a collection of files, and a max. capacity of storage media (e.g. CD),
> how to compute the best-fit mix of files to store leaving zero bytes free on
> each CD?

This is more of an algorithm question than a Perl question.  Once you
have an algorithm (even a bad one), we can start discussing Perl.

> I'm sure it has to be an optimal (mean fast and simple) solution to this,

Nope.  Funny, this was just asked a few days ago.  See the thread:

    stat() or 'real' filesize of a file in an iso-filesystem

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Mon, 2 Apr 2001 11:26:45 +0300
From: "novastar" <root@novastar.dtds.net>
Subject: help page refresh runs the script again !
Message-Id: <986199707.206717@athnrd02.forthnet.gr>

I have a web based script which sends email with Net::SMTP . The problem is
that when the user sends the email and for some reason refresh the screen
then an other one mail is being send . How can I stop this naughty behaviour
?
I try $query->delete_all() at the end of the script with no success.

George




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

Date: 2 Apr 2001 13:03:06 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: Help with CGI scripts
Message-Id: <9a9taa$mjv$4@216.155.32.18>

In article <9a7ahp$gkp$1@newsg3.svr.pol.co.uk>,
 "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net> 
 wrote:

 | In article <slrn9cct50.rl0.garry@zfw.zvolve.net>, garry@ifr.zvolve.net 
 | wrote:
 | > How about skipping all that guessing and read the server's error log to
 | > find out?  Why is that so hard?  
 | 
 | That's only if you have access to the error logs, and they're verbose
 | enough to be of help, and you aren't sharing a server with several
 | thousand other people... Sure, if it's your own server it's dead easy but
 | if you're using someone else's it isn't always...

there's a couple of ways to do this depending on _how_ you want to deal 
with it:

first, you'll need telnet access.. then find out where your ISP keeps 
their web error logs. 

Example 1:
sh-2.00$ cat /var/weblog/magpage_error_log |grep 'sgodin' |grep 'Feb 14' 
|less 

  or 

Example 2:
sh-2.00$ tail -f /var/weblog/magpage_error_log

and then go to the script generating the errors (and make it generate 
them) and watch for them to appear in the shell window. :) 

HTH

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: Sat, 31 Mar 2001 01:28:17 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: Help with CGI scripts
Message-Id: <3AC524A1.E4F8C813@ntlworld.com>

check the (apache?) webserver log, stderr is redirected to it.
alternativly, use something LIKE, not exactly: CGI
qw(fatals_to_browser);
then errors go to client, good for debugging, shameful in production.

Ciaran McCreesh wrote:

> In article <3AC4C2D9.601E52E0@avellano.datsi.fi.upm.es>, "Jose Luis
> Lombana Aramendia" <jlombana@avellano.datsi.fi.upm.es> wrote:
> > require "headers.pl";
> >
> > after #!/usr/local/bin/perl, I get
> >
> > 500 Server Error
>
> 1) Check the file exists and is in path
> 2) Check permissions
> 3) Check file returns true
> 4) Check the code
> 5) Run the script from command line and look for more debug info



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

Date: 31 Mar 2001 04:40:00 GMT
From: kevin metcalf <xzrgpnys@yvtugubhfrovm.pbz>
Subject: help with modifying files
Message-Id: <3AC5605B.A260CE8@yvtugubhfrovm.pbz>

Hey all,

I have a file (from a game I like to play called xcom2 which the author
has dubbed "abandon ware") that contains the specs on all the soldiers
in my army (up to 253).  Each soldier's data is exactly 69 blocks (from
0x00 to 0x45, for example).  I am trying to write a program (in win32
perl) that will modify certain offsets (0x1A-0x1D, 0x21-0x22, and 0x45)
based on passed in parameters.  I've done this kind of thing in linux
(usually to strip out stuff I didn't want passed to a cgi script) buy I
thought someone here might have already done it in win32.  I know it's
not THAT difficult to go from linux to win32, but I can't seem to get it
to work correct.  I've had great success going to the gods that live
here before, so I thought I would try again.  TIA!

kevin metcalf
--
Kevin Metcalf
(Carbon Ocelot)
email: xzrgpnys@yvtugubhfrovm.pbz
Huh?  http://www.flactem.com/utils/rot13.html


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

Date: 30 Mar 2001 22:56:47 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: help with modifying files
Message-Id: <9a3o2f$el9$1@boomer.cs.utexas.edu>

In article <3AC5605B.A260CE8@yvtugubhfrovm.pbz>,
kevin metcalf  <xzrgpnys@yvtugubhfrovm.pbz> wrote:
>I have a file (from a game I like to play called xcom2 which the author
>has dubbed "abandon ware") that contains the specs on all the soldiers
>in my army (up to 253).  Each soldier's data is exactly 69 blocks (from
>0x00 to 0x45, for example).  I am trying to write a program (in win32
>perl) that will modify certain offsets (0x1A-0x1D, 0x21-0x22, and 0x45)
>based on passed in parameters.

So use read() (and binmode()) to read records one by one.
Then use unpack() to build a data structure out of each record.
Then modify the data structures at will.
Then use pack() to put them back together into the correct format,
and then write them back out.

  - Logan
-- 
whose?  my  your   his  her   our   their   _its_
who's?  I'm you're he's she's we're they're _it's_


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

Date: Mon, 2 Apr 2001 17:58:05 +0000 (UTC)
From: friendly@hotspur.psych.yorku.ca (Michael Friendly)
Subject: HELP: need simple replacement for IPC::Run run() function
Message-Id: <9aaejd$48e$1@sunburst.ccs.yorku.ca>

I posted this below last week, but no one replied. I'll try again,
in hopes some kind soul will answer...

I am unable to install IPC::Run on my 5.004 perl system, and need to
find a simple replacement for the run() function, which is used in another
module, in the form

run \$program, \$input, \$output;
return $output;

I can do this with a piped-open, but I'm not sure how to handle
the fact that the  name of the output variable is passed by reference.

Here's what I tried.  Can someone help?

#! /usr/local/bin/perl

sub run {
	my ($program, $input, $output) = @_;
	open(RUN, "$$program $$input|");
	while ($in = <RUN>) {
		$lines .= $in;
	}
	print $lines;
	$$output = $lines;
}


$program = "ls";
$input = '*.pl';

run \$program, \$input, \$output;

print "Got:\n$$output";
exit;



--
Michael Friendly     Email: friendly@yorku.ca (NeXTmail OK)
Psychology Dept
York University      Voice: 416 736-5115  Fax: 416 736-5814
4700 Keele Street    http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA


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

Date: Mon, 02 Apr 2001 16:39:37 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Histograms?
Message-Id: <3AC90DB8.D32EC334@sequenom.com>

Just in case I forgot to mention it (which I did) in my previous posts
about GD::Graph does anyone know of a perl module that will do
histograms?  Or do I have to manually draw it out using GD or
ImageMagick?

Thanks,
Bryan



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

Date: 31 Mar 2001 08:31:13 GMT
From: Joonas Timo Taavetti Kekoni <jkekoni@cc.hut.fi>
Subject: HmacSHA1 for perl and java
Message-Id: <9a44kh$1hm2k$1@midnight.cs.hut.fi>

Has anyone used the HMacSHA1 with perl and java JCE 1.2.1?

I would be digesting ascii strings with no multibyte characters
with binary secret key.

Has anyone had compability problems between the implementations?
Anternative algorithms?(HMAC MD5)

-- 
	_-  Joonas Kekoni       OH2MTF	    I                           -_
	_-internet:	jkekoni@cc.hut.fi   I       DO NOT EAT.         -_
	_-slowmail:	j{mer{ntaival 7a176 I                           -_
	_-		02150Espoo          I      It is a monitor      -_
	_-		Finland/Europe      I                           -_


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

Date: Mon, 02 Apr 2001 03:29:12 GMT
From: afshin akbari <afshin.akbari@sympatico.ca>
Subject: how do you pass 2 hash to a sub
Message-Id: <3AC773B5.2F230F94@sympatico.ca>

All,


Is there a way to pass two hash to a sub and return
two hash from the sub. A pointer pr an example would be great.


Thanks in advance.
aa-


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

Date: Sun, 01 Apr 2001 23:34:04 GMT
From: Al <"al<NoSpam>sorrell"@yahoo.com>
Subject: Re: how to access HTML pages with username and password
Message-Id: <3AC7BAED.58142B2D@yahoo.com>



ALEXANDRU wrote:
> 
> -- Hy everbody
> 
> I have some acces to scientifical revue with USERNAME and password.
> Becauseare many article i want to fetshc only the articles for my
> interest with a Perl program.
> I want to know hao to make a program in perl to make a request typo:
> 
> $content= HTTP request ($url,$username,$password)
> 
> thanks
> 
> Alex

Check CPAN for LWP

Al


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

Date: Sat, 31 Mar 2001 10:56:21 +0200
From: "Peter" <peter@venturenet.co.za>
Subject: Re: How to create " Who is OnLine " page ?
Message-Id: <3ac59b11$0$228@hades.is.co.za>

This is a multi-part message in MIME format.

------=_NextPart_000_023F_01C0B9D1.38FD4640
Content-Type: text/plain;
	charset="windows-1256"
Content-Transfer-Encoding: quoted-printable

If you have access to the authentication sever (IF you have dial-in =
service), then you probably have a *nix box and run Radius. Just get =
RADWHO to pipe to a web-page. Radwho is the Radius accouting / login =
systems way of showing who is online. If you run Livinngston =
portmasters, it can still be done.

  ""Support"" <kwakeb@arabicteam.com> wrote in message =
news:000701c0b943$70d30980$5d0066d4@computer2000...
  Hi
  I created a small script that need a username and password
  but I need a Page to tell Who is online from the users ?
  can I do this by cookies , and how ?
  Regards
  Perl Lover

------=_NextPart_000_023F_01C0B9D1.38FD4640
Content-Type: text/html;
	charset="windows-1256"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=3Dltr><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 5.50.3825.1300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>If you have access to the =
authentication sever (IF=20
you have dial-in service), then you probably have a *nix box and run =
Radius.=20
Just get RADWHO to pipe to a web-page. Radwho is the Radius accouting / =
login=20
systems way of showing who is online. If you run Livinngston =
portmasters, it can=20
still be done.</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>""Support"" &lt;<A=20
  href=3D"mailto:kwakeb@arabicteam.com">kwakeb@arabicteam.com</A>&gt; =
wrote in=20
  message <A=20
  =
href=3D"news:000701c0b943$70d30980$5d0066d4@computer2000">news:000701c0b9=
43$70d30980$5d0066d4@computer2000</A>...</DIV>
  <DIV><FONT face=3DArial color=3D#000000 size=3D2>Hi</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>I created a small script that need a =
username and=20
  password</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>but I need a Page to tell Who is =
online from the=20
  users ?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>can I do this by cookies , and how =
?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Regards</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Perl =
Lover</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_023F_01C0B9D1.38FD4640--



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

Date: Sat, 31 Mar 2001 01:10:43 +0200
From: "Marc Beck" <marc.beck@bigfoot.com>
Subject: how to delete files?
Message-Id: <9a33pf$3jisk$1@ID-23826.news.dfncis.de>

Hello,

I justed found a function for renaming files, but where is the equivalent
to remove/delete files.

perldoc -q remove
perldoc -q delete
perldoc -f remove
 ...

didn't find my any useful results.

cu Marc



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

Date: Fri, 30 Mar 2001 23:21:25 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: how to delete files?
Message-Id: <3ac514c2.144212769@news.erols.com>

On Sat, 31 Mar 2001 01:10:43 +0200, "Marc Beck"
<marc.beck@bigfoot.com> wrote:

>I justed found a function for renaming files, but where is the equivalent
>to remove/delete files.

perldoc -f unlink


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

Date: Mon, 2 Apr 2001 18:15:05 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: How to do this in perl ?
Message-Id: <slrn9chgd9.pp.abigail@tsathoggua.rlyeh.net>

REL (rel@null.net) wrote on MMDCCLXXI September MCMXCIII in
<URL:news:MPG.1532c028874ca089989680@news.rel.tmfweb.nl>:
-: Hello,
-: 
-: I want to prompt a user for input and then change the 
-: quoted parts in the textfile with what the user entered.
-: I looked at sed, cut and awk but coulden't find a way
-: to replace a given postition on a given line. (not searsh & replace)
-: 
-: I dont know any perl and am not sure if this is somthing easy to
-: do with it. If it is then could you please give me some tips.

Here's a tip: if you want to do something in language X, you better
know enough of X to be able to do what you need to do. Not knowing any
X isn't going to do much for you.

-: Owh yeah, What is the best scripting lang to learn. I know about shell
-: scripting. But like i encounter now it does not cover everything.
-: Does Perl cover all. Or are you people mixing Perl with sh, Sed, Awk 
-: etc.. ??


Best? The existance of a multitude of languages must indicate that there
is no universal best language.



Abigail
-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


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

Date: Mon, 02 Apr 2001 04:11:37 GMT
From: "joeybach" <unknown@spammesenseless.com>
Subject: How to matching multiple patterns in a string in any order.
Message-Id: <ZZSx6.11131$z4.3179097@typhoon.tampabay.rr.com>

Can any one tell me how to match muliple patterns in a string that would
not be dependant on the order the that the patterns appear in the string?

$message =~ /foo.*bar/   will match any thing with foo followed by bar.


What I am looking to do is match any line containing foo and bar no
matter how it is listed in the line.


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

Date: Mon, 02 Apr 2001 06:34:28 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: How to matching multiple patterns in a string in any order.
Message-Id: <slrn9cg7bk.s46.garry@zfw.zvolve.net>

On Mon, 02 Apr 2001 04:11:37 GMT, joeybach <unknown@spammesenseless.com> wrote:
> Can any one tell me how to match muliple patterns in a string that would
> not be dependant on the order the that the patterns appear in the string?
> 
> $message =~ /foo.*bar/   will match any thing with foo followed by bar.
> 
> 
> What I am looking to do is match any line containing foo and bar no
> matter how it is listed in the line.

  /(?=.*foo)(?=.*bar)/

-- 
Garry Williams


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

Date: Mon, 02 Apr 2001 23:58:16 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: How to use Net::SMTP through a firewall (proxy)?
Message-Id: <sm8y6.541$T3.191395840@news.frii.net>

In article <tchl2ptcj9r264@corp.supernews.com>,
David J. Marcus <djmarcus@ex-pressnet.com> wrote:
>
>My questions:
>    - How can I send mail through a firewall?
>    - Is there a general config parameter somewhere that I could use to
>centrally set the proxy server info? (I am hoping that a common setting
>could affect SMTP, LWP and other networking apps)
>

You can get email through your firewall the same way as your desktop e-mail
client does it.  You probably just need to tell Net::SMTP to use an official
'mailhost' inside the firewall, the same one that your desktop e-mail
client does.

Since SMTP is a different protocol than HTTP it is not likely that
the same configuration data would apply to both.

chris
-- 
    This space intentionally left blank


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

Date: Mon, 02 Apr 2001 17:53:27 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: howto detect safeperl
Message-Id: <3AC8AE87.421EC4E9@ntlworld.com>

I haven't ever used safe perl but isn't the answer in the question?  (the bit
about $0???)

Reuben Logsdon wrote:

> hello all,
>
> some of my customers are being forced to run under their Perl CGI programs
> under safeperl, rather than normal perl.
>
> safeperl prevents many things from working like network i/o, disk i/o,
> system calls.  safeperl also replaces the $0 value with the path to
> itself, which causes all of my scripts to fail in unexpected ways because
> they have $0 dependencies.
>
> i would like to auto-detect that safeperl is running and nicely tell the
> user 'sorry i don't run on safeperl' but i can't find any good docs on
> safeperl and the $] thing just returns 5.003.  anyone know how to
> programmatically detect safeperl?  (i would prefer to not try a test
> system call or disk i/o and then trap for failure, since i would be doing
> this with every exec for my 99.9999% customers who don't use safeperl)
>
> --
> Regards,
> Reuben Logsdon
>
> http://www.io.com/~rlogsdon/



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

Date: Tue, 03 Apr 2001 00:49:54 GMT
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: HUP signal handling
Message-Id: <3AC91F0E.FBD40EA0@earthlink.net>

Dave wrote:
> 
> Marc Bigler wrote:
> 
> > ...The problem that I am getting is the following: the first kill
> > -HUP on the perl process will work perfectly...But if then I ...
> > kill -HUP to restart it again then ...it just seems that it doesn't
> > want to process anymore my HUP.
> >
> 
> I thought this problem went away a while ago, but I do know that on
> older System V systems once a signal handler was invoked the signal
> handler would be cleared unless the signal handler re-installed
> itself. This was eliminated later since it introduced a race
> condition. (The second occurrence of a signal might arrive before the
> signal handler was reinstalled.)

Your response ignores the exec down at the bottom of &reinitialize.

He's not using reinitialize to clear the globals and go back to the
beginning of the script, he's using it to tell the program to clean up
after itself, and then start *everything* from the beginning, as if the
program had just been started at the commandline.

> You can easily test whether or not this is the case on your system by
> including a "$SIG{HUP} = \&reinitialize;" statement within your
> "reinitialize" subroutine, preferably near the top of the sub so as to
> minimize the chances of a race condition. (Or, better yet, set
> $SIG{HUP} to 'IGNORE' at the top and then reset it to \$reinitialize
> at the bottom.)

reinitialize never exits.  It calls exec.

> Then kill -HUP yourself two times.
> 
> Good luck,
> Dave Kernen

-- 
Sometimes the journey *is* its own reward--but not when you're trying to
get to the bathroom in time.


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

Date: Fri, 30 Mar 2001 17:11:09 -0800
From: Bryan Coon <bcoon@sequenom.com>
Subject: Image Reloading Problem
Message-Id: <3AC52EAC.D31A98ED@sequenom.com>

Does anyone know a trick to make sure an image reloads fresh everytime
from netscape?  I am generating dynamic images, and it is a problem that
if the file has the same name, netscape checks its cache first before
loading the image.  Even if you specify check against document every
time in preferences.

I remember reading once about a trick of adding some random number to
the end of the image name when it is called, or something to that
effect, that makes netscape think it is a new image.... does anyone know
how to get around this?  Or know of that trick I am babbling about?

Thanks,
Bryan



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

Date: Sat, 31 Mar 2001 06:31:13 GMT
From: "Cary Z" <caryz@hotmail.com>
Subject: Re: Image Reloading Problem
Message-Id: <RQex6.18433$8y.2498028@typhoon.austin.rr.com>

> I remember reading once about a trick of adding some random number to
> the end of the image name when it is called, or something to that
> effect, that makes netscape think it is a new image.... does anyone know
> how to get around this?  Or know of that trick I am babbling about?

I used Time::HiRes to get the microsecond and used it as a "random" number.

Good luck.




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

Date: Mon, 02 Apr 2001 15:01:54 -0500
From: Bing Du <bing-du@tamu.edu>
Subject: keep configurations in central place
Message-Id: <3AC8DAB2.1FC782DF@tamu.edu>

I have some basic configurations (e.g. server name, port, data types,
etc.) that may be used by many different scripts.  Instead of define the
configs in every script, how should I put them in just one place and
have all other scripts 'include' it?  Do I need to write a module
containing the configs for the scripts to 'use'?

Bing



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

Date: Mon, 02 Apr 2001 21:09:48 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: keep configurations in central place
Message-Id: <3AC8DC8C.B06171DA@ntlworld.com>

try App::Config

http://www.perldoc.com/cpan/App/Config.html


Bing Du wrote:

> I have some basic configurations (e.g. server name, port, data types,
> etc.) that may be used by many different scripts.  Instead of define the
> configs in every script, how should I put them in just one place and
> have all other scripts 'include' it?  Do I need to write a module
> containing the configs for the scripts to 'use'?
>
> Bing



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

Date: Mon, 02 Apr 2001 16:41:43 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: keep configurations in central place
Message-Id: <comdog-137F7A.16414302042001@news.panix.com>

In article <3AC8DAB2.1FC782DF@tamu.edu>, Bing Du <bing-du@tamu.edu> 
wrote:

> I have some basic configurations (e.g. server name, port, data types,
> etc.) that may be used by many different scripts.  Instead of define the
> configs in every script, how should I put them in just one place and
> have all other scripts 'include' it?  Do I need to write a module
> containing the configs for the scripts to 'use'?

you don't need to write a module, although that is one way to do
that.  you might want to start with a perl library where you
define the common code, and then get more sophisicated when you
have more time.

good luck :)

-- 
brian d foy <comdog@panix.com>



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

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 V10 Issue 603
**************************************


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