From edelsys at swlink.net Sat May 1 19:50:07 1999 From: edelsys at swlink.net (Anthony R. Nemmer) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: phoenix.pm In-Reply-To: <37095730.DF276D0@dancris.com> References: Message-ID: <3.0.5.32.19990501175007.00888130@swlink.net> How did the phoenix.pm meeting go? Who all was there? Sorry I missed it! I will try to make the next one. How often does phoenix.pm meet? Thanks, Tony -- -- Anthony R. Nemmer -- EdelSys Consulting edelsys@swlink.net -- http://www.edelsys.com/ -- http://www.swlink.net/~edelsys/ -- Opera r0ks! http://www.operasoftware.com/ -- From dmiles at primenet.com Mon May 3 16:39:36 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: phoenix.pm In-Reply-To: <3.0.5.32.19990501175007.00888130@swlink.net> References: <37095730.DF276D0@dancris.com> Message-ID: <3.0.3.32.19990503143936.00995100@pop.primenet.com> At 05:50 PM 5/1/99 -0700, you wrote: >How did the phoenix.pm meeting go? >Who all was there? Sorry I missed it! > >I will try to make the next one. >How often does phoenix.pm meet? > We're meeting on the sencond and fourth Thursdays of each month. There were about six of us there. Doug and Julie Miles From dmiles at primenet.com Fri May 7 12:55:15 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: I can't figure it out Message-ID: <3.0.3.32.19990507105515.0096db90@pop.primenet.com> I am trying to get a friend interested in perl, and have been trying to give him a small script that is close to something he wants to do. The idea is that he can modify it to do exactly what he wants, and thereby learn some perl. The problem is that I can't get it to work. He is a C programmer, so I took a script from the cookbook, and I've been 'C'ifing it. The problem is that the original version works, but mine doesn't. I was wondering if any of you can tell me why. Its probably something stupid, but right now I don't see what it is. Both scripts are supposed to recurse directories provided on the command line, and find the largest file. I'm doing this in Winbloze 95. perl -v says: This is perl, version 5.005_02 built for MSWin32-x86-object Copyright 1987-1998, Larry Wall Binary build 507 provided by ActiveState Tool Corp. http://www.ActiveState.com Built 15:08:32 Nov 14 1998 Here is the original script: use File::Find; @ARGV = ('.') unless @ARGV; my ($saved_size, $saved_name) = (-1, ''); sub biggest { return unless -f && -s _ > $saved_size; $saved_size = -s _; $saved_name = $File::Find::name; } find(\&biggest, @ARGV); print "Biggest file $saved_name in @ARGV is $saved_size bytes long.\n"; here is my version: use File::Find; # If no command-line arguments are provided, set to the current directory. if(!@ARGV) { @ARGV = ('.'); } my $file_name = ''; my $file_size = -1; find(\&biggest, @ARGV); print "Biggest file $file_name is $file_size bytes.\n"; # biggest ###################################################################### sub biggest { # This is just for debugging info. if(-f _) { print "$_ $File::Find::name: " . (stat(_))[7] . "\n"; } if((-f _) && ((stat(_))[7] > $file_size)) { # Get the largest file's filename and size. $file_size = (stat(_))[7]; ($file_name = $File::Find::name) =~ s!/!\\!g; print "Biggest file $file_name is $file_size bytes.\n"; } } # END: biggest The problem with my script is that it is returning the correct largest file size, but the wrong file name (it is another file in the same directory as the true largest file). Just FYI, I was using '-s _' but was having problems with it, so I replaced it with '(stat(_))[7]'. Any clues are greatly appreciated. Thanks. Doug and Julie Miles From edelsys at swlink.net Fri May 7 14:01:35 1999 From: edelsys at swlink.net (Anthony R. Nemmer) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: I can't figure it out In-Reply-To: <3.0.3.32.19990507105515.0096db90@pop.primenet.com> Message-ID: <3.0.5.32.19990507120135.007ded10@swlink.net> At 10:55 AM 5/7/99 -0700, you wrote: >I am trying to get a friend interested in perl, and have been trying to >give him a small script that is close to something he wants to do. The >idea is that he can modify it to do exactly what he wants, and thereby >learn some perl. The problem is that I can't get it to work. He is a C >programmer, so I took a script from the cookbook, and I've been 'C'ifing >it. The problem is that the original version works, but mine doesn't. I >was wondering if any of you can tell me why. Its probably something >stupid, but right now I don't see what it is. Both scripts are supposed to >recurse directories provided on the command line, and find the largest >file. I'm doing this in Winbloze 95. perl -v says: > First of all, use Linux, not Windows. Second of all, tell your friend about what really makes perl cool: 1: hash tables (associative arrays), built into the core syntax of the language, as easy to use as arrays! 2: complete powerful regular expression pattern matching language, built into the core syntax of the language. 3: disappearing $_ 4: multi-paradigm. The list goes on, but that's a start. =) Tony >This is perl, version 5.005_02 built for MSWin32-x86-object > >Copyright 1987-1998, Larry Wall > >Binary build 507 provided by ActiveState Tool Corp. http://www.ActiveState.com >Built 15:08:32 Nov 14 1998 > >Here is the original script: > >use File::Find; >@ARGV = ('.') unless @ARGV; >my ($saved_size, $saved_name) = (-1, ''); >sub biggest { > return unless -f && -s _ > $saved_size; > $saved_size = -s _; > $saved_name = $File::Find::name; >} >find(\&biggest, @ARGV); >print "Biggest file $saved_name in @ARGV is $saved_size bytes long.\n"; > >here is my version: > >use File::Find; > ># If no command-line arguments are provided, set to the current directory. >if(!@ARGV) >{ > > @ARGV = ('.'); > >} > >my $file_name = ''; >my $file_size = -1; > >find(\&biggest, @ARGV); > >print "Biggest file $file_name is $file_size bytes.\n"; > ># biggest >###################################################################### > >sub biggest >{ > > # This is just for debugging info. > if(-f _) > { > > print "$_ $File::Find::name: " . (stat(_))[7] . "\n"; > > } > > if((-f _) && ((stat(_))[7] > $file_size)) > { > > # Get the largest file's filename and size. > $file_size = (stat(_))[7]; > ($file_name = $File::Find::name) =~ s!/!\\!g; > print "Biggest file $file_name is $file_size bytes.\n"; > > } > >} # END: biggest > >The problem with my script is that it is returning the correct largest file >size, but the wrong file name (it is another file in the same directory as >the true largest file). Just FYI, I was using '-s _' but was having >problems with it, so I replaced it with '(stat(_))[7]'. Any clues are >greatly appreciated. Thanks. > >Doug and Julie Miles > -- -- Anthony R. Nemmer -- EdelSys Consulting edelsys@swlink.net -- http://www.edelsys.com/ -- http://www.swlink.net/~edelsys/ -- Opera r0ks! http://www.operasoftware.com/ -- From dmiles at primenet.com Fri May 7 14:22:40 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: I can't figure it out In-Reply-To: <3.0.5.32.19990507120135.007ded10@swlink.net> References: <3.0.3.32.19990507105515.0096db90@pop.primenet.com> Message-ID: <3.0.3.32.19990507122240.0093c3e0@pop.primenet.com> At 12:01 PM 5/7/99 -0700, you wrote: >At 10:55 AM 5/7/99 -0700, you wrote: >>I am trying to get a friend interested in perl, and have been trying to >>give him a small script that is close to something he wants to do. The >>idea is that he can modify it to do exactly what he wants, and thereby >>learn some perl. The problem is that I can't get it to work. He is a C >>programmer, so I took a script from the cookbook, and I've been 'C'ifing >>it. The problem is that the original version works, but mine doesn't. I >>was wondering if any of you can tell me why. Its probably something >>stupid, but right now I don't see what it is. Both scripts are supposed to >>recurse directories provided on the command line, and find the largest >>file. I'm doing this in Winbloze 95. perl -v says: >> > >First of all, use Linux, not Windows. Second of all, tell your friend >about what really makes perl cool: He needs it for is Windows PC at work. I do use Linux. :) > 1: hash tables (associative arrays), built into the core syntax of > the language, as easy to use as arrays! > > 2: complete powerful regular expression pattern matching language, > built into the core syntax of the language. > > 3: disappearing $_ > > 4: multi-paradigm. He already knows about these cool things. I just wanted to give him a small project to get him started. Thanks for the response! Doug and Julie Miles From bryan.lane at rez.com Fri May 7 14:25:16 1999 From: bryan.lane at rez.com (Lane, Bryan) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: I can't figure it out Message-ID: I'm going to look at this, and see what I can figure out. You may be waiting a while though, as I'm one of the least experienced with Perl who is in the group. Later, Bryan > -----Original Message----- > From: Doug and Julie Miles [mailto:dmiles@primenet.com] > Sent: Friday, May 07, 1999 10:55 AM > To: phoenix-pm-list@happyfunball.pm.org > Subject: Phoenix.pm: I can't figure it out > > > I am trying to get a friend interested in perl, and have been > trying to > give him a small script that is close to something he wants > to do. The > idea is that he can modify it to do exactly what he wants, and thereby > learn some perl. The problem is that I can't get it to work. > He is a C > programmer, so I took a script from the cookbook, and I've > been 'C'ifing > it. The problem is that the original version works, but mine > doesn't. I > was wondering if any of you can tell me why. Its probably something > stupid, but right now I don't see what it is. Both scripts > are supposed to > recurse directories provided on the command line, and find the largest > file. I'm doing this in Winbloze 95. perl -v says: > > This is perl, version 5.005_02 built for MSWin32-x86-object > > Copyright 1987-1998, Larry Wall > > Binary build 507 provided by ActiveState Tool Corp. > http://www.ActiveState.com > Built 15:08:32 Nov 14 1998 > > Here is the original script: > > use File::Find; > @ARGV = ('.') unless @ARGV; > my ($saved_size, $saved_name) = (-1, ''); > sub biggest { > return unless -f && -s _ > $saved_size; > $saved_size = -s _; > $saved_name = $File::Find::name; > } > find(\&biggest, @ARGV); > print "Biggest file $saved_name in @ARGV is $saved_size bytes > long.\n"; > > here is my version: > > use File::Find; > > # If no command-line arguments are provided, set to the > current directory. > if(!@ARGV) > { > > @ARGV = ('.'); > > } > > my $file_name = ''; > my $file_size = -1; > > find(\&biggest, @ARGV); > > print "Biggest file $file_name is $file_size bytes.\n"; > > # biggest > ###################################################################### > > sub biggest > { > > # This is just for debugging info. > if(-f _) > { > > print "$_ $File::Find::name: " . (stat(_))[7] . "\n"; > > } > > if((-f _) && ((stat(_))[7] > $file_size)) > { > > # Get the largest file's filename and size. > $file_size = (stat(_))[7]; > ($file_name = $File::Find::name) =~ s!/!\\!g; > print "Biggest file $file_name is $file_size bytes.\n"; > > } > > } # END: biggest > > The problem with my script is that it is returning the > correct largest file > size, but the wrong file name (it is another file in the same > directory as > the true largest file). Just FYI, I was using '-s _' but was having > problems with it, so I replaced it with '(stat(_))[7]'. Any clues are > greatly appreciated. Thanks. > > Doug and Julie Miles > From dmiles at primenet.com Fri May 7 18:49:05 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: I can't figure it out (Shay's reply) In-Reply-To: <3.0.3.32.19990507122240.0093c3e0@pop.primenet.com> References: <3.0.5.32.19990507120135.007ded10@swlink.net> <3.0.3.32.19990507105515.0096db90@pop.primenet.com> Message-ID: <3.0.3.32.19990507164905.00942210@pop.primenet.com> This bounced for some reason. This is Shay's reply. Bryan also came to the same solution. Thanks to Shay and Bryan. Shay said: It has to do with the '_' filehandle that is causing the problems. I think since you reference it twice in the 'biggest' sub, it is always a file behind what it should be? If you make the following change, it works fine: sub biggest{ if(-f $_){ ## Change '_' to '$_' print "$_ $File::Find::name: " . (stat(_))[7] . "\n"; } if((-f _) && ((stat(_))[7] > $file_size)) { $file_size = (stat(_))[7]; ($file_name = $File::Find::name) =~ s!/!\\!g; print "Biggest file $file_name is $file_size bytes.\n"; } } This will give you the biggest file in the current tree, not directory. Anyway the problem lies in the special filehandle you are using. The File.pm uses this same filehandle so you may be clashing with it. You may want to check out the symbol tables by dumping the File object and printing out the current value in your program to see what's going on. If you do the following you will see what I mean: sub biggest{ if(-f _){ ## Change '_' to '$_' print "",(stat(_))[7]," => ",(stat($_))[7],"\n"; #print "$_ $File::Find::name: " . (stat(_))[7] . "\n"; } if((-f _) && ((stat(_))[7] > $file_size)) { $file_size = (stat(_))[7]; ($file_name = $File::Find::name) =~ s!/!\\!g; #print "Biggest file $file_name is $file_size bytes.\n"; } } You'll see that _ is not equal to $_ as you may think. I tried outputting _ as a filename and the only way I could get at it was to declare the following ${_} which is equivalent to $_. Shay >here is my version: > >use File::Find; > ># If no command-line arguments are provided, set to the current directory. >if(!@ARGV) >{ > > @ARGV = ('.'); > >} > >my $file_name = ''; >my $file_size = -1; > >find(\&biggest, @ARGV); > >print "Biggest file $file_name is $file_size bytes.\n"; > ># biggest >###################################################################### > >sub biggest >{ > > # This is just for debugging info. > if(-f _) > { > > print "$_ $File::Find::name: " . (stat(_))[7] . "\n"; > > } > > if((-f _) && ((stat(_))[7] > $file_size)) > { > > # Get the largest file's filename and size. > $file_size = (stat(_))[7]; > ($file_name = $File::Find::name) =~ s!/!\\!g; > print "Biggest file $file_name is $file_size bytes.\n"; > > } > >} # END: biggest Doug and Julie Miles From sharding at ccbill.com Mon May 10 16:47:10 1999 From: sharding at ccbill.com (Shay Harding) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: Perl internals questions Message-ID: <99051015085600.05210@shay.cwie.net> Just wondering the following: Which is faster at execution, uses less memory, best overall in terms of performance: use CGI qw(:standard); print header print start_html etc or use CGI; $cgi = new CGI; print $cgi->header print $cgi->start_html etc; ?? Using the OO implementation seems to be the best choice. Just wondering if any one knows which is better overall and why? Since there is a global package 'main' can one script access another's variables if they know what they are. I haven't tried this yet and am just wondering if anyone knows. Or is it the case that each script has it's own global package 'main'? Last question... Can you create namespaces dynamically like so: $var = "A"; sub create_namespace($){ package $_[0]; # or maybe eval ($string = "package $_[0]"); } sub write_to_package($$$){ my ($package,$var_name,$var_value) = @_; %$package::$var_name = $var_value; } Just a few questions I've been thinking of. Shay From pedrohonez at yahoo.com Mon May 10 18:19:17 1999 From: pedrohonez at yahoo.com (Peter Jones) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: Perl internals questions Message-ID: <19990510231917.5968.rocketmail@web803.mail.yahoo.com> --- Shay Harding wrote: > Just wondering the following: > > Which is faster at execution, uses less memory, best overall in terms > of > performance: > > > use CGI qw(:standard); > print header > print start_html > etc > > > or > > > use CGI; > $cgi = new CGI; > > print $cgi->header > print $cgi->start_html > etc; > > ?? > > Using the OO implementation seems to be the best choice. Just > wondering if any one knows which is better > overall and why? > > There is a small overhead when using OO in Perl. I have not found the need to use the OO side of CGI.pm. I like to use OO, but only when it makes sense and in this case I do not see the need. I have never needed to have more then one instance of a CGI object, or have found anything really useful with using the OO syntax of CGI. Maybe I am wrong but I think that it just adds to the amount of typing you do and I am lazy. As far as the "why" goes, Perl has to look up which package the object belongs to, then look up the method that you are calling and even follow the the chain of inheritance if neccessary. I can't see this adding too much time but I do know that it does add some time. As far as memory, it all depends on the internal reprasentaion of the object. If it is a hash it is slower and bigger but nicer to work with. An array seems to be that fastest and smallest but less used. I prefer the hash myself. > > Since there is a global package 'main' can one script access > another's > variables if they know what they are. I haven't tried this yet and am > just > wondering if anyone knows. > > Or is it the case that each script has it's own global package > 'main'? > each running script is being run by it's own Perl interpeter so there is no way of using another scripts variables with out some magic. You can use System V Shared Memory if you are on a system that supports it. I find it easier to use Unix domain sockets and just communicate that way. You can also try using Threads and make your scripts into one script if that makes sense for what you are doing. > > > > Last question... > > > Can you create namespaces dynamically like so: > > > $var = "A"; > > sub create_namespace($){ > package $_[0]; # or maybe eval ($string = "package > $_[0]"); > } > > > sub write_to_package($$$){ > my ($package,$var_name,$var_value) = @_; > %$package::$var_name = $var_value; > } > > I played around with it and this is the only way that I could get it to work: $x = "Apackage"; eval "package $x; \$a = 1"; package main; # can't access $x for some reason $y = "Apackage::a"; print $$y, "\n"; # prints 1 I tried putting the $a after the eval but it did not work. > > Just a few questions I've been thinking of. > Cool! > > Shay > > > === Peter J Jones Surprise, Arizona === <((>< === _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From Beaves at aol.com Tue May 11 00:22:37 1999 From: Beaves at aol.com (Beaves@aol.com) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: writing to packages Message-ID: Shay wrote... Last question... Can you create namespaces dynamically like so: $var = "A"; sub create_namespace($){ package $_[0]; # or maybe eval ($string = "package $_[0]"); } sub write_to_package($$$){ my ($package,$var_name,$var_value) = @_; %$package::$var_name = $var_value; } ++++++++++++++++= OK, maybe I'm missing something here, but I from what I read, the answer is pretty straightforward. package main; $a = 'A'; package Page; # now refer to the symbol table for "Page $a = 'PageA' # assigning $a in the Page symbol table to 'PageA' package main; print $a; # outputs 'A' print $Page::a; # outputs 'PageA' $Page::a = 'newPageA'; # reassigning $a in the symbol table 'Page' # here is where I don't quite get your subroutine, because you really don't need # one. Just preface your variable assignment or creation with the package name. print $Page::a; #ouputs 'newPageA' Since, I consider myself relatively new to the Perl game, I may have missed the point of your question entirely, (it may have been more in depth). If that's the case, then please don't take offense with me talking about stuff you already may know. Tim. p.s. were you asking again about two separate Perl scripts accessing each others packages? Or just one script, and how the packages can talk to one another? From mekla at geocities.com Tue May 11 01:07:13 1999 From: mekla at geocities.com (mekla@geocities.com) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: writing to packages In-Reply-To: Message-ID: <19990511060202.HPSK8978.mail.rdc1.az.home.com@guardian> > Shay wrote... > Can you create namespaces dynamically like so: > > $var = "A"; > > sub create_namespace($){ > package $_[0]; # or maybe eval ($string = "package $_[0]"); > } > > sub write_to_package($$$){ > my ($package,$var_name,$var_value) = @_; > %$package::$var_name = $var_value; > } > ++++++++++++++++= > > OK, maybe I'm missing something here, but I from what I read, the answer is > pretty straightforward. > > package main; > $a = 'A'; > > package Page; # now refer to the symbol table for "Page > $a = 'PageA' # assigning $a in the Page symbol table to 'PageA' > > package main; > print $a; # outputs 'A' > print $Page::a; # outputs 'PageA' > $Page::a = 'newPageA'; # reassigning $a in the symbol table 'Page' > > # here is where I don't quite get your subroutine, because you really don't > need > # one. Just preface your variable assignment or creation with the package > name. > I put the subroutine there so I don't have to keep doing something like below ... and I'm lazy :) package X; etc, etc package Y; etc, etc package main; code, code Just gets really messy. With a sub to create the initial package and another to create vars in a package I should be able to create packages on the fly within the main and populate them. > p.s. were you asking again about two separate Perl scripts accessing each > others packages? Or just one script, and how the packages can talk to one > another? Actually both. I am really into agents/bots and delving into AI. I want scripts to be able to find out what other scripts are doing or what they can do. If I have an agent mulling around my HD (want to move it to the web) and it sees a script (doesn't know what it is yet). I want it to dynamically create a package from that script and run it contained to see what it does. Then instruct it to do something, or modify it to do something. I figured if it sucks the script into a string, I can push that string into a namespace, parse it for dangerous commands like: `cd /`; `rm -rf *`; then eval it to watch it run and see what it does. Also if my agent does: @procs = `ps ax | grep perl`; I want it to be able to look inside another script's symbol table and see what's inside of there. This will give an indication of what the script does, what modules it's referring to, etc. Shay From sinck at today.com Tue May 11 10:17:58 1999 From: sinck at today.com (David A Sinck) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: writing to packages References: <19990511060202.HPSK8978.mail.rdc1.az.home.com@guardian> Message-ID: <14136.18461.236000.449015@SINCK> \_ Just gets really messy. With a sub to create the initial package \_ and another to create vars in a package I should be able to create \_ packages on the fly within the main and populate them. eval &build_package(@args); # ought to do the trick given the right # &build_package and @args \_ Actually both. I am really into agents/bots and delving into AI. I \_ want scripts to be able to find out what other scripts are doing or \_ what they can do. Thereby hangs a tale. \_ If I have an agent mulling around my HD (want to \_ move it to the web) and it sees a script (doesn't know what it is \_ yet). I want it to dynamically create a package from that script and \_ run it contained to see what it does. Heh. Um, look for Safe or some such, be sure to run with tainting. \_ Then instruct it to do \_ something, or modify it to do something. I figured if it sucks the \_ script into a string, I can push that string into a namespace, parse \_ it for dangerous commands like: \_ \_ `cd /`; \_ `rm -rf *`; Well, that's nice in theory, but can you get your program to figure out if this is dangerous?: *_=\$#;$/=q#(.)#;$#=10;$^X=~s|.*/||;$\=chr;$#=gmtime$#;substr($#,$^F#^F *$^F**$^F-1)=al;s$\$/( )\$/\$/$e\$2\u\$^X\$2\$3o\$1r$ && print time *I* say this is safe, because I know what it does, but could a program decide that it was ok? [Bonus points for those who haven't seen this before and can figure out what it does w/o interpreter.] Or what about the standard $my_rm_cmd = (random($seed)[5,3,2,76]); which builds a random dicitionary, then derefs the characters in it to build 'rm -rf /' in a string? Or what about system('makenorm -rf $args'); # =~ /rm -rf/ There's a heap of problems associated with determining whether a program is 'safe' automagically, and the few I've pointed out are just the tip.... \_ I want it to be able to look inside another script's symbol table and \_ see what's inside of there. This will give an indication of what the \_ script does, what modules it's referring to, etc. You might want to check out the Apache mod_perl stuff for something similar since everything is in the same name space. David From mekla at geocities.com Tue May 11 16:49:45 1999 From: mekla at geocities.com (Shay Harding) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: writing to packages References: <14136.18461.236000.449015@SINCK> Message-ID: <99051115085006.05804@shay.cwie.net> >\_ Then instruct it to do >\_ something, or modify it to do something. I figured if it sucks the >\_ script into a string, I can push that string into a namespace, parse >\_ it for dangerous commands like: >\_ >\_ `cd /`; >\_ `rm -rf *`; > >Well, that's nice in theory, but can you get your program to figure >out if this is dangerous?: > >*_=\$#;$/=q#(.)#;$#=10;$^X=~s|.*/||;$\=chr;$#=gmtime$#;substr($#,$^F#^F >*$^F**$^F-1)=al;s$\$/( )\$/\$/$e\$2\u\$^X\$2\$3o\$1r$ && print time > >*I* say this is safe, because I know what it does, but could a program >decide that it was ok? [Bonus points for those who haven't seen this >before and can figure out what it does w/o interpreter.] Herein lies the problem... how to determine what is dangerous. This is all basically theory and just things I was thinking of. I have no code for any of this. I mean how do you really find out if something is dangerous. Something as simple as: $var = \@{$contents}[0]; or $self->{VAR} = \@{$contents}[0]; This could be dangerous depending on what is stored there. There may be encrypted text in there which can't be recognized until decrypted then analyzed. Since Perl is so flexible you could build a string from the hex code for the characters. There are a lot of possibilities and it would take too long to go through each one for every line of code. >There's a heap of problems associated with determining whether a >program is 'safe' automagically, and the few I've pointed out are just >the tip.... I agree just like there's a heap of problems to try and dynamically parse a web page for specific data. How do you know where it is, what format? Could just pattern match but that will more than likely return undesired data, etc. This is where it would be nice to have some sort of fuzzy algorithms to determine, with a degree of accuracy, what is safe, what is closest to the set of conditions you set. And if it is wrong, it needs to be able to 'remember' this and not do it again. (It being the agent or bot in question). These are exactly the sort of things discussed on a perl-ai list I subscribe to. Lots of questions and few answers. -- Shay From cms at oreilly.com Mon May 17 20:25:30 1999 From: cms at oreilly.com (Christina Silveira) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: sourceXchange from O'Reilly Message-ID: <3.0.3.32.19990517182530.009d7960@pop.primenet.com> We're pleased to introduce sourceXchange, a new Web-based service developed by Brian Behlendorf, our CTO, New Ventures and co-founder of the Apache Project. SourceXchange is an online exchange where sponsors with code development needs and Open Source developers can meet to create solutions together. Our framework makes it easy for sponsors to support Open Source projects that address their specific concerns--and it guarantees payment to the developers who work on those projects. In addition, sourceXchange guarantees developers that code written for an Open Source project will be released under the appropriate Open Source license and will be archived on a publicly available website so that anyone can download and use it. For more information about sourceXchange, go to http://www.sourcexchange.com. From dmiles at primenet.com Mon May 17 20:30:34 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: Social Meeting 03/18/1999 Message-ID: <3.0.3.32.19990517183034.00949e90@pop.primenet.com> We're having a Phoenix.pm meeting at La Canasta Mexican Restaurant at 7:00PM on Thursday March 20th. The address is 5502 N 7th Ave. (7th Ave & Missouri). It is right across from the MAC America building. Please RSVP via email (dmiles@webpulse.com) so I can get a head count to let the restaurant know. I'll make sure that the people at the door point you in the right direction. Just tell them you're with the Perl group. Doug and Julie Miles Doug and Julie Miles From dmiles at primenet.com Mon May 17 20:31:48 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: Social Meeting 05/20/1999 Message-ID: <3.0.3.32.19990517183148.009d4890@pop.primenet.com> Ignore the date in the subject on the previous message. We're having a Phoenix.pm meeting at La Canasta Mexican Restaurant at 7:00PM on Thursday March 20th. The address is 5502 N 7th Ave. (7th Ave & Missouri). It is right across from the MAC America building. Please RSVP via email (dmiles@webpulse.com) so I can get a head count to let the restaurant know. I'll make sure that the people at the door point you in the right direction. Just tell them you're with the Perl group. Doug and Julie Miles Doug and Julie Miles From coyotl at primenet.com Mon May 17 20:39:06 1999 From: coyotl at primenet.com (Glen G. Walker) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: Social Meeting 05/20/1999 In-Reply-To: <3.0.3.32.19990517183148.009d4890@pop.primenet.com> Message-ID: sorry, somebody told me we met on the second and fourth thursdays of the month, so I have plans on the 20th... :) On Mon, 17 May 1999, Doug and Julie Miles wrote: > Ignore the date in the subject on the previous message. > > We're having a Phoenix.pm meeting at La Canasta Mexican Restaurant at > 7:00PM on Thursday March 20th. The address is 5502 N 7th Ave. (7th Ave & > Missouri). It is right across from the MAC America building. Please RSVP > via email (dmiles@webpulse.com) so I can get a head count to let the > restaurant know. I'll make > sure that the people at the door point you in the right direction. Just > tell them you're with the Perl group. > > Doug and Julie Miles > > > > Doug and Julie Miles > ------------------------------------------------------------------------------- Glen G. Walker, coyotl@primenet.com www.primenet.com/~coyotl ------------------------------------------------------------------------------- From dmiles at primenet.com Mon May 17 20:51:24 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: New Tutorial on Class Data Posted Message-ID: <3.0.3.32.19990517185124.00971da0@pop.primenet.com> New Tutorial on Class Data Posted [Links] Tom Christiansen posted [0]perltootc, which "shows how to cast off the chains of C++ so you can use simple, native Perl idioms to manage class data attributes in your Perl object classes by revealing OO strategies and techniques a C++ programmer could never imagine." It is available in several flavors, including POD, HTML, text, man (troff), and PostScript. http://language.perl.com/misc/perltootc.html Doug and Julie Miles From dmiles at primenet.com Mon May 17 20:57:51 1999 From: dmiles at primenet.com (Doug and Julie Miles) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: Social Meeting 05/20/1999 In-Reply-To: References: <3.0.3.32.19990517183148.009d4890@pop.primenet.com> Message-ID: <3.0.3.32.19990517185751.00970ad0@pop.primenet.com> At 06:39 PM 5/17/99 -0700, you wrote: > > >sorry, somebody told me we met on the second and fourth thursdays of the >month, so I have plans on the 20th... :) That does it! You're excommunicated (or whatever)! ;) I just got a new job last week, so the second Thursday didn't work out too well for me... Doug and Julie Miles From edelsys at swlink.net Mon May 24 16:46:44 1999 From: edelsys at swlink.net (Anthony R. Nemmer) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: this is just to let you all know.. Message-ID: <3.0.5.32.19990524144644.0080ce40@swlink.net> To the Phoenix.PM folks: This is just to let you know that although I really enjoy being a member of Phoenix.PM mailing group, unfortunately I have not ever and will not ever be able to attend a live Phoenix.PM meeting, due to scheduling conflicts. So, see you all on the email list! Thanks, Tony -- -- Anthony R. Nemmer -- EdelSys Consulting edelsys@swlink.net -- http://www.edelsys.com/ -- Opera r0ks! http://www.operasoftware.com/ -- From Beaves at aol.com Sat May 29 19:48:20 1999 From: Beaves at aol.com (Beaves@aol.com) Date: Thu Aug 5 00:17:28 2004 Subject: Phoenix.pm: My Object Oriented HTML tool. Message-ID: I am nearing completion of my HTML::Tag module. I am happy with the results so far. I am 'beta' testing it right now, and am pleased with the results. I originally started off with just wanting to create HTML tables from a database. While working on this project, I realized that with a few modifications, I could use this code to produce HTML for any situation. The neat thing (IMHO) is that each Tag object can hold text, instructions for text, references to scalars and arrays which will be dereferenced at run time. And of course, each object can hold other tag objects, which will go thru the same process iteratively when invoked via the 'as_string' method. I am going to have the beta version posted soon at my site, and I'll let y'all know thru this forum when I do. In the meantime, though, does this spark anyone's curiosity? Did I reinvent the wheel? Is there a current module out there that someone is using that does the same sort of stuff? Oh, yeah, another neat thing is that you can automate the value for any attribute created for each tag. If used for the ID attribute, this will enable some fancy onMouseOver, and onMouseOut scripting via JavaScript for tables (resulting from a search, etc). I've tested this in concept, and it seems to work OK. Since it is this sort of thing that got me going in the first place, I thought this ability deserves some mention. Well, take care. I'm very anxious to get to a meeting and meet y'all. I have some great internet ideas that I'd like to float by the group. Hey, EBay had to start somewhere, right? Tim EXAMPLE CODE: $page = Page->new(); $page->TITLE->contents('A super title!'); $scalarref = 'flibbidy'; $page->BODY->push('A string', \$scalarref, TagP->new('A new paragraph')); print $page->as_string; # will produce... #Mime type will print here by default... A super title! A string flibbidy A new paragraph