Re: binary perl

2004-01-24 Thread Dan Anderson
On Fri, 2004-01-23 at 20:44, Dan Brow wrote: > Is it possible to make a perl script/program a binary file? There is an experimental perl compiler. It's not recommended for production use but is a cool toy. When Perl 6 comes out that will all change though... -Dan -- To unsubscribe, e-mail:

Re: can i do it with perl ?

2004-01-24 Thread Dan Anderson
On Fri, 2004-01-23 at 20:49, John McKown wrote: > On Fri, 23 Jan 2004, Dan Anderson wrote: > > > > > Give me a little bit of time with a soldering iron, some wire, and a > > laptop connected to your home network and your dishwasher and that can > > be rectified.

Re: can i do it with perl ?

2004-01-23 Thread Dan Anderson
On Fri, 2004-01-23 at 18:07, wolf blaum wrote: > > I there, > Hi, > > I need to write a web database application using > > perl, and i need a way that when the users logs into > > the system i download all the information regarding > > to the user to its local computer and make all the > >

Re: Need help comparing lines in two files

2004-01-22 Thread Dan Anderson
One more thing, those loops I was telling you about, just using a pair of brackets, also keep their scope. It's a good way to clean up with yourself, i.e. my $foo = 40; { my $foo = 50; print $foo; # prints 50 # garbage collector called on all declarations before here } print $foo; # prints

Re: Need help comparing lines in two files

2004-01-22 Thread Dan Anderson
Lets say file 1 is: foo bar ... continues on for 100 lines And file 2 is: foo baz bar ... continues on exactly the same 100 lines as file 1 Would file 2 be different from file 1 from line 2 and down? Or would it be different for line 2 and 3? Also, the keywords: next; Brings you to the next

Re: How to take command line argument and use it to run an upgrade script.

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 18:14, Jeff Collins wrote: > I'm a perl newby. > I'm looking on taking a command line argument from > STDIN and use it for input to a script that upgrades > software. Any examples would be greatly appreciated. STDIN is already open when your perl script starts so you can read

Re: Survey : Max size allowable for slurping files

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 18:21, Dan Anderson wrote: > On Thu, 2004-01-22 at 17:59, James Edward Gray II wrote: > > On Jan 22, 2004, at 4:12 PM, Tim Johnson wrote: > > > > > Here's another argument against slurping: When you slurp a file all at > > > once, even

Re: Survey : Max size allowable for slurping files

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 17:59, James Edward Gray II wrote: > On Jan 22, 2004, at 4:12 PM, Tim Johnson wrote: > > > Here's another argument against slurping: When you slurp a file all at > > once, even if your program isn't using up much of the CPU, on many > > machines it will slow down performance

RE: Survey : Max size allowable for slurping files

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 16:49, Dan Muey wrote: > > > But I see a lot of "don't slurp that" and I was hoping for more > > > clear reasons/situatuions to or not to slurp so people > > positn code can have a better idea why a perosn said: > > > "do(n't) slurp your file here" > > > > > > Basically we n

RE: Survey : Max size allowable for slurping files

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 16:32, Dan Muey wrote: > > On Thu, 2004-01-22 at 16:16, Dan Muey wrote: > > > > On Thu, 2004-01-22 at 13:18, Dan Muey wrote: > > > > > There are always comments like "you can slurp the file > > as long as > > > > > it's not too big" or "becareful not to slurp a really > > b

RE: Survey : Max size allowable for slurping files

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 16:16, Dan Muey wrote: > > On Thu, 2004-01-22 at 13:18, Dan Muey wrote: > > > There are always comments like "you can slurp the file as > > > long as it's not too big" or "becareful not to slurp a > > > really big file or you'll be in trouble". > > > > I'd like to add that s

Is it necessary to set the headers when using LWP::UserAgent->post

2004-01-22 Thread Dan Anderson
I noticed in the POD for LWP::UserAgent that the post method doesn't have an option to add headers. Are headers (like UserAgent:) not needed for POSTing? Or am I missing how to do it? Thanks in advance, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Newbie

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 14:13, JoÃo Figueira wrote: > Well, I'm a newbie. Just got started in Perl and was stunned by its power. > The thing is i'm running the scripts in WinXP. Can you tell how to use CGI > scripts in XP, because if ai try to set a CGI script as ACTION in a forme it > just gets read

Re: Survey : Max size allowable for slurping files

2004-01-22 Thread Dan Anderson
On Thu, 2004-01-22 at 13:18, Dan Muey wrote: > There are always comments like "you can slurp the file as > long as it's not too big" or "becareful not to slurp a > really big file or you'll be in trouble". I'd like to add that some of it depends on swap space. I've slurped well past physical me

Calling SUPER::constructor in the constructor

2004-01-22 Thread Dan Anderson
Is it possible to call the constructor that a function inherits from its parent? I tried calling SUPER:: and SUPER-> in a constructor and got errors. Am i correct in assuming that if I rewrite the constructor that a copy of the parent object won't be available? Thanks in advance, Dan -- To u

Re: Program to write code

2004-01-21 Thread Dan Anderson
On Wed, 2004-01-21 at 17:32, Marcelo wrote: > Hi, could anyone recommend a good program to write code, currently using notepad. I really like Emacs, but it has a high learning curve. Check out: http://www.xemacs.org/ And, of course, not everyone likes Emacs. Better check out ViM as well: http:

Re: Help with fileglob: Unix vs. Windows?

2004-01-21 Thread Dan Anderson
On Wed, 2004-01-21 at 11:52, McMahon, Chris wrote: > Hello... > This script works fine on Unix: > > #!/usr/local/bin/perl > use warnings; > use strict; > my $dir = "/usr/home/admin"; > my @files = glob ("$dir/*"); > print @files; > > > But this script doesn't do right in Windows: > > u

Re: Loop Runners

2004-01-20 Thread Dan Anderson
> Can people please contribute on other ways to do the same thing. Please begin by > #3, #4.. etc as you read on different ways. use strict; use sub; my @a = @ARGV; my @array = @a; # 1 while (scalar (@array)) { my $element = shift (@array); main::process($element); } @a = @ARGV; #2 main:

Writing custom cookies using LWP::UserAgent

2004-01-20 Thread Dan Anderson
I am having LWP::UserAgent fetch information from a site that uses Javascript to write a cookie like this: document.cookie = "jscript=1; path=/;"; Is there any way to tell my User Agent to add that cookie to the cookie jar? Thanks, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: Saying an item is empty

2004-01-19 Thread Dan Anderson
scalar (@array) can be used to find the number of elements in @array. @{$foo} can be used to work with the array represented by the array reference $foo you can combine the two for scalar(@{$foo}) Also remember hashes are even sized arrays. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Re: parse email

2004-01-19 Thread Dan Anderson
On Mon, 2004-01-19 at 11:00, Paul Kraus wrote: > > Evolution (Sorry, Linux only) and (I believe) Mozilla support shell > > commands on e-mails. > > > > Switching would also block infection from a number of viruses Outlook > > always seems to be plagued with. > > Agreed. I am Linux man myself but

OT: Re: parse email

2004-01-19 Thread Dan Anderson
On Mon, 2004-01-19 at 09:50, Paul Kraus wrote: > Is there anyway I can get outlook to run a perl script whenever mail from a > particular user arrives? Evolution (Sorry, Linux only) and (I believe) Mozilla support shell commands on e-mails. Switching would also block infection from a number of vi

Re: exit perl script and cd in bash?

2004-01-19 Thread Dan Anderson
On Mon, 2004-01-19 at 02:05, John W. Krahn wrote: > Kenton Brede wrote: > > > > I've been searching the archives and google for an answer. I suspect it > > can't be done but thought I'd ask. > > > > What I'm trying to do is create a tool such as "cdargs", in perl, to > > simplify moving between

Re: Calculations with date

2004-01-18 Thread Dan Anderson
100:1 there's a date arithmetic module on CPAN which would do exactly what you need. However, (at least from my point on the net), CPAN appears to be down. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: C# on linux

2004-01-18 Thread Dan Anderson
> One problem though... you can't use Visual Studio on Linux, because it's > MS-ware. That's not 100% true. Of course, whether or not he can run it without any problems is a different story. If I remember correctly and Hummingbird allows him to do the Windoze equivalent of an ssh with X f

Re: C# on linux OT

2004-01-18 Thread Dan Anderson
On Mon, 2004-01-19 at 04:26, rhlinux wrote: > hello all, > Do any one know how can i run C# on linux, and if i can use the visual studio editor. > and How please This is way off topic. However, there are a number of ways to run windows programs on Linux, including Wine, Crossover Office, VMWare

Re: what is this data structure?

2004-01-17 Thread Dan Anderson
> You're terminology is a little confusing, but I think you have the > right idea. For the benefit of the original poster: The => symbol is usually used to signify a hash and automatically quote the key to the left of it. I.e.: my %hash1 = ( foo => 'bar', bar => 'baz'

RE: Why isn't perl used more in business and industry

2004-01-17 Thread Dan Anderson
On Sat, 2004-01-17 at 15:21, Dan Muey wrote: > > Which has made me wonder more then once if in a security > > through obscurity approach sites pass perl scripts off as ASP, etc. > > > Maybe, I don't see why I'd want to make people think I'm using insecure > stuff when I'm really using the best,

Re: unscribe

2004-01-17 Thread Dan Anderson
On Fri, 2004-01-16 at 11:43, Walter Valenti wrote: > How i can unscribe ??? At the bottom of all e-mails you'll see this: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -Dan -- To

Re: what is this data structure?

2004-01-17 Thread Dan Anderson
On Sat, 2004-01-17 at 15:12, James Edward Gray II wrote: > On Jan 17, 2004, at 2:02 PM, Dan Anderson wrote: > > > On Fri, 2004-01-16 at 11:03, Jack Chen wrote: > >> Hi, > >> > >> I don't know how to work with this data structure:

RE: Why isn't perl used more in business and industry

2004-01-17 Thread Dan Anderson
> - Are those on servers you work with? Those specific ones may use those for whatever > reason. No, just whenever I cruise the net I'm always surprised to see scripts ending in .asp or .jsp. I understand that some people prefer Java to Perl, but I know there are a lot of people out there who li

Re: what is this data structure?

2004-01-17 Thread Dan Anderson
On Fri, 2004-01-16 at 11:03, Jack Chen wrote: > Hi, > > I don't know how to work with this data structure: > > my @array = ((a => 'appple'), > (b => 'tree'), >(c => 'chair')); That "array" is an array of hashes. -Dan -- To u

Why isn't perl used more in business and industry

2004-01-17 Thread Dan Anderson
Most of the scripts I see end in an extension like .jsp, .asp, .dll, or something which says that they aren't perl. Is there a reason more businesses and online companies don't use perl? -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Suggestions for Submitting to CPAN

2004-01-17 Thread Dan Anderson
I've read the tutorial on creating a Makefile.PL for a module I'm submitting to CPAN, and I've applied for a PAUSE ID, but I was curious if anyone whos been through the process before knows of any pit falls I should be careful of, or any suggestions on how to make my life easier. Thanks in advance

Re: Dumping values of all vars

2004-01-15 Thread Dan Anderson
On Thu, 2004-01-15 at 18:17, James Edward Gray II wrote: > On Jan 15, 2004, at 5:06 PM, Dan Anderson wrote: > > > And I agree that Data::Dumper is much more complicated then it needs to > > be. > > Data::Dumper is a standard module and I find it super useful. I just &g

Re: Dumping values of all vars

2004-01-15 Thread Dan Anderson
> As a rule though, Data::Dumper doesn't erase data, as you can see below: One more thing. I have noticed a problem with Data::Dump where if the data structures are too complex the data can disapear. I'm not quite sure why. Usually I use it in {}s on a temporary variable which is a copy of what

Re: Dumping values of all vars

2004-01-15 Thread Dan Anderson
On Thu, 2004-01-15 at 17:59, James Edward Gray II wrote: > On Jan 15, 2004, at 4:40 PM, Dan Anderson wrote: > > > I use the Data::Dump package which is a standard module. > > I'm willing to bet you actually use Data::Dumper. Oh yeah, how much are we betting? My car could

Re: Dumping values of all vars

2004-01-15 Thread Dan Anderson
On Thu, 2004-01-15 at 17:59, James Edward Gray II wrote: > On Jan 15, 2004, at 4:40 PM, Dan Anderson wrote: > > > I use the Data::Dump package which is a standard module. > > I'm willing to bet you actually use Data::Dumper. Nope. I use Data::Dump. Then I call Data:

Re: Dumping values of all vars

2004-01-15 Thread Dan Anderson
On Thu, 2004-01-15 at 12:35, zentara wrote: > On Wed, 14 Jan 2004 12:40:31 -0700, [EMAIL PROTECTED] (Jdavis) wrote: > > >Hello, > > Is it possible to dump the values of all the vars in a perl script > >easily? I want to have a sub called Error that when called > >will tell me the current value of

Re: JPG FILE DOUBTS

2004-01-15 Thread Dan Anderson
Check out http://search.cpan.org/ . I found a number of results doing a quick search for both JPEG and JPG. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Apel of VIM was Emacs Wizards

2004-01-15 Thread Dan Anderson
On Wed, 2004-01-14 at 18:22, Jeff Westman wrote: > Incidently, emacs has a 'dired mode' (directory editor) which is > very nice... much like the old 'list' shareware in DOS land of the > dark past you can bring up a list of files (like 'ls -l'), then > view and selectively execute or delete all

Re: Emacs Wizards

2004-01-15 Thread Dan Anderson
On Wed, 2004-01-14 at 11:07, Paul Kraus wrote: > Is there a way to easily have emacs comment out xnumber of lines. M-x comment-region will comment out a marked region. C-x ( starts defining a macro. Type the keys you'd normally type to comment out a line, i.e. C-a # SPC Now hit C-x ). The macro

RFC: Prototyping, do or don't?

2004-01-13 Thread Dan Anderson
I am somewhat confused as to when to prototype a subroutine. Under the tips section Programming Perl makes the following points: 1. Prototyping can lead to inlined functions which increases the speed of commonly used functions. Prototype when you can. 2. As soon as somebody use

Re: script works from shell but not http

2004-01-12 Thread Dan Anderson
On Mon, 2004-01-12 at 12:12, [EMAIL PROTECTED] wrote: > Thanks everyone, > > The reason the BEGIN statement was there is I don't exactly know where my > error logs are and it's faster to just read the file. Plus if it wasn't a > script problem the err.txt file wouldn't be created. I don't k

Do Else Unless Statements Exist?

2004-01-11 Thread Dan Anderson
Does Perl have any kind of else / unless statements, sort of like elsif? I tried: if ($foo) { } else unless ($bar) { } but it just gave me syntax errors. And I guess I could just do: if ($foo) { } else { unless ($bar) { } } But the place in the code I was trying it was for clarity, and all

Re: script works from shell but not http

2004-01-11 Thread Dan Anderson
On Sun, 2004-01-11 at 11:47, zentara wrote: > On Sun, 11 Jan 2004 06:10:32 EST, [EMAIL PROTECTED] wrote: > > >#!/usr/bin/perl -w > >use strict; > >BEGIN{open(STDERR, ">./err.txt")} > >print "Content-Type: text/html\n\n"; > >foreach my $key (sort keys %ENV) { > > print "\$ENV{$key} = $ENV{$key}

Re: Matching invalid characters in a URL

2004-01-11 Thread Dan Anderson
On Fri, 2004-01-09 at 16:54, Wiggins d Anconia wrote: > > > Any suggestions? Thanks for your help and thoughts. > > > > It is much easier to define the set all chars must be in then not. Use > > the =! which is the complement of all charachters matched by =~. > > Alternatively, I believe there i

Re: Matching invalid characters in a URL

2004-01-09 Thread Dan Anderson
> Any suggestions? Thanks for your help and thoughts. It is much easier to define the set all chars must be in then not. Use the =! which is the complement of all charachters matched by =~. Alternatively, I believe there is a c option you can use. -Dan -- To unsubscribe, e-mail: [EMAIL PROTE

Re: Use of FOR statement

2004-01-08 Thread Dan Anderson
On Wed, 2004-01-07 at 20:39, Paul Harwood wrote: > I am reading through a book on Objects and References and I don't > understand this statement: > > $sum += $_ for split //; FWIW, for is synonymous with foreach. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: PERL debuggers

2004-01-07 Thread Dan Anderson
I'd like to add that it's not a debugger like the one someone else posted for stepping through your code and setting breakpoints. It's designed to allow you to create a log with the state of your script and what has been done, so that way you can have somebody who is not a programmer and who is us

Re: PERL debuggers

2004-01-07 Thread Dan Anderson
I've created a module that I am planning on eventually releasing to CPAN which provides a good framework for debugging. Basically you can have your code report 4 types of warnings: INFO WARNING ERROR FATAL_ERROR You can also assign a "class" to each and turn on or off all of one type or all of

Re: stop

2004-01-07 Thread Dan Anderson
Uhhh...at the bottom of every list message is: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Integrating perl scripts into KDE / Gnome

2004-01-07 Thread Dan Anderson
I was curious if anyone knows a good resource on integrating Perl scripts into KDE (and I suppose gnome). I want to start doing things like adding my scripts to my taskbar, and was curious if that was possible without compiling C extensions. Thanks in advance, Dan -- To unsubscribe, e-mail: [

killing processes after x seconds

2004-01-06 Thread Dan Anderson
Is it possible to (easily) tell perl to kill itself and all children if the script doesn't execute in x seconds? I thought about forking the script and having the parent sleep for x seconds at the top of the process, but that seems like a lot of extra code. I was hoping there wa

Re: (I wish there was a) cpan user's guide

2004-01-06 Thread Dan Anderson
On Tue, 2004-01-06 at 02:10, chris wrote: > I keep feeling I should learn more before I post here (lest I look like a lazy > idiot who can't RTFM), but I'm getting too old to wait! http://search.cpan.org/~gaas/URI-1.29/URI.pm Search CPAN under URI instead of URL. -Dan -- To unsubscribe, e-ma

Re: Learning Objects, destroy methods

2004-01-06 Thread Dan Anderson
I don't know if anybody has mentioned it yet, but check out weak references on CPAN: http://search.cpan.org/~lukka/WeakRef-0.01/WeakRef.pm -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Microsoft Services for UNIX/LINUX

2004-01-05 Thread Dan Anderson
On Mon, 2004-01-05 at 15:03, drieux wrote: > On Jan 5, 2004, at 9:32 AM, <[EMAIL PROTECTED]> wrote: > [..] > > I was wondering if anyone on this list have had any luck with this > > technique of executing UNIX-based applications. One thing that comes > > to > > mind is CGI-scripting, but this is

Re: Learning Objects, destroy methods

2004-01-05 Thread Dan Anderson
> My problem is one of destroying a block (object), making sure that I have no > memory leakage. Out of curiosity, when you say memory leakage do you mean that the memory persists after the Perl process exits, or just while it is running? And have you verified this? And, is the program a daemon

Re: deleting a hash ref's contents

2004-01-05 Thread Dan Anderson
IIRC, Perl's garbage collection system sits in the background waiting until it finds a chunk of memory not referenced by any variable and then deletes it. So references to anything keep the memory connected to the reference in play until either Perl dies or there are no variables which con

Which is better: GTK or TK

2004-01-05 Thread Dan Anderson
I am trying to extend my perl skills to the point of being able to create programs with GUIs. I found a tutorial to both GTK and TK -- but the TK tutorial did in one line what the GTK tutorial did in many. I was wondering what the pros and cons of TK and GTK were, and whether GTK involves signifi

Hacks via Slow regular expressions

2004-01-02 Thread Dan Anderson
I was reading O'Reilly's Programming Perl, and under the security section it says that regular expressions from outside the program are not trusted because it is possible that they can take forever to execute. I was curious exactly what kind of regular expression

Re: Problems with LWP::UserAgent

2003-12-26 Thread Dan Anderson
> "Fair use" is copyright law -- I don't know whether you're infringing > anybody's copyright, but you're certainly violating O'Reilly's Terms of > Service, which requires that you agree: > > not to use "Web spiders" or any other automated retrieval > mechanisms when using the Service othe

Re: Problems with LWP::UserAgent

2003-12-26 Thread Dan Anderson
> Call me an old fogy, but I think that some of the mechanization of Web > communications has gone too far. Providing interactive features in the CGI > is one thing. It provides services for both sides of any transaction > involved. Batch harvesting of pages meant for human perusal, like batch >

Problems with LWP::UserAgent

2003-12-24 Thread Dan Anderson
I am trying to create a spider to grab my books off of Safari for a batch printing job so I don't need to go through each chapter myself and hit the Print button. So I used this script to try and log myself in to the safari site: # BEGIN CODE #! /usr/bin/perl use strict; use warning

Re: Preventing Accidentally Fork Bombing My Box

2003-12-19 Thread Dan Anderson
drieux <[EMAIL PROTECTED]> writes: > On Dec 19, 2003, at 8:55 AM, Dan Anderson wrote: > [..] > > I'm creating an app that uses forks in a number of places to do things > > quicker. Unfortunately, I have a bad habit of accidentally fork > > bombing > > my

Re: how to remove a ^M charaters from a variable

2003-12-19 Thread Dan Anderson
On Fri, 2003-12-19 at 11:54, Dan Anderson wrote: > > "\r" > > Caveat: Only on *nix systems. Otherwise \n is 0x1512 and not 0x12. That should read Otherwise \n can be 0x1512 -- i.e. on Windoze boxen. On Macs it's something different. -Dan -- To unsubscribe, e-

Preventing Accidentally Fork Bombing My Box

2003-12-19 Thread Dan Anderson
I'm creating an app that uses forks in a number of places to do things quicker. Unfortunately, I have a bad habit of accidentally fork bombing my box. Is there any way I can run a perl process (even if it's a Linux command) so that it wont eat up all available resources if I screw up? Or do I ju

Re: how to remove a ^M charaters from a variable

2003-12-19 Thread Dan Anderson
> "\r" Caveat: Only on *nix systems. Otherwise \n is 0x1512 and not 0x12. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: silly qn,.

2003-12-17 Thread Dan Anderson
On Thu, 2003-12-18 at 06:03, Ajey wrote: > hi, > how can i find which perl modules are installed on linux os? Well Linux distributions differ in what they install, and even then you can install or uninstall or change what modules are installed yourself, so pretty much you're never guaranteed that

RE: Problems with Inheritance in GD::Graph

2003-12-17 Thread Dan Anderson
On Wed, 2003-12-17 at 14:04, Ed Christian wrote: > Dan Anderson wrote: > > I am trying out GD::Graph, which is a CPAN module that creates a > > method new, and then for each graph type inherits that new method (I > > think -- I had to open the code). > > > >

Nevermind WAs: Re: Problems with Inheritance in GD::Graph

2003-12-17 Thread Dan Anderson
Nevermind. I'm an idiot. I fogot to use GD::Graph::bars. :: hits head against wall:: Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Problems with Inheritance in GD::Graph

2003-12-17 Thread Dan Anderson
I am trying out GD::Graph, which is a CPAN module that creates a method new, and then for each graph type inherits that new method (I think -- I had to open the code). So I tried calling: my $graph = GD::Graph::bars->new(400, 600); And I get the error: Can't locate object method "new" via pac

getting rid of whitespace at the beginning and end of a string

2003-12-12 Thread Dan Anderson
Is there a way to chomp all whitespace both at the beginning and end of a string? I was thinking of using a regexp like s[^\s*?][]sg and s[\s*?$][]sg; Is there a better way? (I'm thinking of PHP's trim function) -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Re: md5 function

2003-12-11 Thread Dan Anderson
On Thu, 2003-12-11 at 05:51, Randy W. Sims wrote: > On 12/11/2003 5:41 AM, Yannick Warnier wrote: > > > Hi all, > > > > Is there an easy function to apply an md5 to a string? (sha1 could also > > do) > > I've looked at the perl base functions and didn't find it but I would > > like to avoid the u

Re: Problems forking -- fork DOSes my comp

2003-12-10 Thread Dan Anderson
On Wed, 2003-12-10 at 17:04, James Edward Gray II wrote: > On Dec 10, 2003, at 3:52 PM, Dan Anderson wrote: > > > I am learning about forks, so I tried the following code to make sure I > > had everything down: > > Still don't believe me about Network Programming wit

Problems forking -- fork DOSes my comp

2003-12-10 Thread Dan Anderson
I am learning about forks, so I tried the following code to make sure I had everything down: #! /usr/bin/perl use strict; use warnings; my $counter = 1; my $pid = 0; while ($counter < 50) { if ($pid = fork) { open ("FORKED", ">./fork/$counter") or die("COULD NOT OPEN FORK"); pri

RE: Get file size without downloading

2003-12-10 Thread Dan Anderson
On Wed, 2003-12-10 at 09:42, Bob Showalter wrote: > usef wrote: > > > Hi, > > > FTP or HTTP? > > > > > > > HTTP, but I want to know the method for FTP as well. Thanks -u > > I think that will work for FTP as well. Give it a try. If I type ls when I FTP into somewhere I get a listing of files an

Re: adding path to $PATH

2003-12-10 Thread Dan Anderson
On Wed, 2003-12-10 at 01:09, Pablo Cusnir wrote: > Hi, > > Is there a way using Perl to add to the environment variable PATH a new path, and > that addition will be valid after the script is ran and not only for the script's > scope. > I'm working in cshell in Solaris 5.8 > The regular way to d

Re: How do I set up bidirectional pipes over a network connection?

2003-12-10 Thread Dan Anderson
On Tue, 2003-12-09 at 20:38, John W. Krahn wrote: > Dan Anderson wrote: > > > > On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: > > > On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: > > > > > > > I have 2 Linux boxes I want to talk

Re: How do I set up bidirectional pipes over a network connection?

2003-12-10 Thread Dan Anderson
On Tue, 2003-12-09 at 17:41, James Edward Gray II wrote: > On Dec 9, 2003, at 4:12 PM, Dan Anderson wrote: > > > Well, I was planning to implement the file transfers using Net::FTP or > > something similar to keep the problems down. But I want every node to > > be abl

Setting the file permissions of a file I'm writing to

2003-12-09 Thread Dan Anderson
Is it possible to specify the permissions of a file I create when I: open ("FOO", "> ./bar") or die ("Could not create file"); Thanks in advance, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Problems compiling Perl 5.6.1

2003-12-09 Thread Dan Anderson
When I try to compile Perl 5.6.1 (can't find any RPMs and, yes, I need 5.6.1), I get the following error: make[1]: Leaving directory `/root/perl-5.6.1/utils' Making x2p stuff make[1]: Entering directory `/root/perl-5.6.1/x2p' make[1]: *** No rule to make target `', needed by `hash.o'. St

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Dan Anderson
> How many boxes are we talking about here? Well starting off, 2. But I would like to expand to several more. Probably never more then 10. > What you're talking about is no small feat. How can we help you? > > You want a server and a client, right? Could it be and FTP server and > a script

RE: How do I set up bidirectional pipes over a network connection ?

2003-12-09 Thread Dan Anderson
> You might look at the standard rdist(1) utility for this kind of thing. > > For crafting network daemons in Perl, Net::Daemon is a good place to start, > IMO. What I am trying to do is too complex to successfully implement using a standard utility like rdist or CVS. Besides, rolling my own is

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Dan Anderson
On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: > On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: > > > I have 2 Linux boxes I want to talk to each other over the local > > network > > using a Perl script. Is it possible to set up a bidirectional pipe so >

How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Dan Anderson
I have 2 Linux boxes I want to talk to each other over the local network using a Perl script. Is it possible to set up a bidirectional pipe so that 2 perl daemons can communicate with each other? How would I go about doing this and are there any modules to help? Thanks in advance, Dan -- To

What are the dangers of leaving a cgi-bin directory CHMOD 777

2003-12-08 Thread Dan Anderson
I have a perl script that writes to its directory, and as such the directory is CHMOD 777 in my cgi-bin. (Linux box) I figured this might be dangerous, but didn't think there was any harm in it. Am I right or will the script kiddies be all over me? -Dan -- To unsubscribe, e-mail:

Replacing text

2003-12-05 Thread Dan Anderson
I have a script that reads text from a file and inserts text into different places depending on what it needs to do. But I use split to replace the text, i.e.: ($first_part, $second_part) = split "#INSERT#TEXT#HERE#", $document, 2; print FILEHANDLE $firstpart, $text_to_insert, $sec

Re: perl is slick

2003-11-30 Thread Dan Anderson
> Vive OO. Rock on. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Don't Send To Me! [OT]

2003-11-30 Thread Dan Anderson
On Mon, 2003-11-24 at 01:54, Jason Dusek wrote: > Hi There, > > Is there some way to get people on this list to stop sending me two > emails at once? I am on the beginner's list - so when you send email > to me and then cc to the list, I get two. Which is annoying. I > suppose I could write

problems with regular expressions

2003-11-29 Thread Dan Anderson
I have a regular expression that looks like: $foo =~ s[class.*?=.*?'.*?'][]sgi; The problem I run into is that if the following is presented to match: The regular expression will match: class='foo'> Is there any way I can tell the .*? to match "" as well as "."? Thanks in advance, Dan -

Re: Viewing logs on other computers.

2003-11-29 Thread Dan Anderson
Although it's not quite the same thing, I wrote a pretty simple Perl script to keep track of disk space usage on a number of file servers. Because df needed to be run as root (access to /proc wasnm't allowed for underprivileged users) I setuided it to root. If I were

problems with case insensitive tr/// regexp

2003-11-27 Thread Dan Anderson
I'm trying to create a script to remove all font tags from an HTML documents. I created a regular expression like this: ,[ working code | use strict; | use warnings; | my $foo =" whe"; | $foo =~ tr/\<.*font.*\>//d; | print $foo, "\n"; `--- Bu

Re: using perl interpreter interactively like python?

2003-11-20 Thread Dan Anderson
On Thu, 2003-11-20 at 14:25, Jeff Kowalczyk wrote: > I'd like to open perl and execute a few commands interactively in the > console. I learn a lot in python this way, and I need to understand some > perl code. Did this kind of thing ever get added to perl? I assume you're talking about how you ca

How does perl compile functions

2003-11-20 Thread Dan Anderson
I'm curious how perl "compiles" functions internally. When the actual C code (or ASM equivalent or bytecode or whatever Perl uses) for a function is run, is there overhead to the function? Are functions inlined? Does perl lazy compile functions? (i.e. functions never used are never compiled and

Re: how do I create self aware functions

2003-11-18 Thread Dan Anderson
> You're looking for ref(), but first let me give you the "This is often > a bad idea" warning. What are you trying to use the object's name for? Debugging. I have a function that writes errors / warnings / errata to logs. Sometimes it could be more transparent if I included things like subrou

how do I create self aware functions

2003-11-18 Thread Dan Anderson
Is it possible to create self aware functions (possibly using a magic variable)? I.e. functions that know their own name. Sort of the oppossite of bless. Basically, I want to create functions like: sub foo { my $self = shift (@_); my $name = decode_blessing ($self); } Does that make

Is it possible to send / receive cookies on an image

2003-11-17 Thread Dan Anderson
Is it possible to create a perl script that would send to the user an image and cookies. Depending on the cookie on the users computer, the user would get a certain picture. I figure I would have to use CGI, but what else, if anything, would I need to do? Thanks in advance, -Dan -- To unsub

Re: writing excel files

2003-11-15 Thread Dan Anderson
I'm pretty sure the newest versions of Excel support the same XML spreadsheet format that OpenOffice does. Of course, if I remember correctly Microsoft was charging more for it (i.e. in Pro version or Enterprise -- not home edition). -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: peeking at the top or bottom of an array

2003-11-13 Thread Dan Anderson
In case anyone is wondering why I want to do this, I am running through an array (popping out all elements) in order. Some things from the array act differently depending on what is left or right of them (if I'm shifting or popping respectively). I want to double check before I pop or shift. -Da

  1   2   >