From rdice at pobox.com Sat Jul 1 10:36:24 2006 From: rdice at pobox.com (Richard Dice) Date: Sat, 01 Jul 2006 13:36:24 -0400 Subject: [Buffalo-pm] Damian Conway in Toronto -- final details Message-ID: <44A6B298.6060903@pobox.com> Hi everyone, The details are finalized for the Damian trip. Looking forward to seeing people out at his talks this week! //////////////////////////////////////////////// What: Perl 6 Update When: Monday July 3 (Canada Day stat holiday) 1:00 - 5:00 pm please aim for arriving around 12:45pm Where: 2 Bloor Street West (CIBC Tower, our usual TPM meeting spot), which is at the NW corner of Yonge & Bloor in downtown Toronto Room # and Floor # as yet to be determined. Note that building access could be tightly controlled, as will elevator access, so we'll have to work according to a system of pre-planned pick-up times as well as phone calls up via cellphone to get the ferryman to pick you up. Other: Dinner & beer follows, 5:30 pm - ?? Location: as yet unknown... we'll just pick a place in the neighbourhood to go following the talk. //////////////////////////////////////////////// What: Toronto BarCamp DemoCamp Damian will give a 15 minute demonstration of the Perl 6 language (That's right -- Perl 6, now!) (4 other presenters each have a chunk of time there too) When: Tuesday July 4 6:30 - 8:00 pm Likely Damian will be speaking towards the end of this time range Where: see more/full details at: http://barcamp.org/TorCampDemoCamp7 //////////////////////////////////////////////// What: "Fun With Dead Languages" http://damian.conway.org/Seminars//DeadLanguages.html When: Wednesday July 5 6:30 - 9:00 pm Where: U. of Toronto Bahen Centre (40 St. George Street, on the w. side of St. George just slightly to the north of College) Room # 1180 http://maps.google.com/maps?f=q&hl=en&q=40+St+George+St,+Toronto,+ON,+Canada&ie=UTF8&ll=43.66039,-79.39682&spn=0.014002,0.043259&om=1 Watch in mesmerized terror as Damian hacks code in five unrelated languages (none of them Perl). Along the way, you'll also learn about modern archaeological techniques, bidirectional cross- dressing, Ancient Greeks hackers, improbable romances, the real Club Med, why programmers shouldn't frequent casinos, the language of moisture vaporators, C++ mysticism, conversational Latin, state machines on steroids, feeding the dog the old-fashioned way, the shocking truth about anime, programming without variables or subroutines, the Four Voids of the Apocalypse, Microsoft's new advertising campaign, what the Romans used instead of braces, drunken stonemasons, the ancient probabilistic wisdom of bodkins, how to kill a language with a single byte, and the price of fish. //////////////////////////////////////////////// Fundraising ----------- There are some costs associated with his trip here, so I am taking up a collection to cover the costs. Any additional money raised will be given to Damian as an honorarium, in support of such an active Perl community member who has supported us so much whenever we use Perl In fact, I aim for there to be such a surplus so that we can help Damian out while he tours North America this summer. If you can and would like to donate please email me. Please note that all of Damian's public talks are free and that he's committed to all of them, regardless of funds raised. All are encouraged to attend -- the more, the merrier! Also note that Fulko Hew has set up a PayPal link to help, in case that's your bag: http://www.hew.ca/ //////////////////////////////////////////////// About Damian ---------------- For those who don't know Damian, he's from Melbourne, Australian, a professor of Computer Science at Monash University who has taken a more-or-less indefinite leave of absence so that he can work on the Perl 6 effort. (He's Larry Wall's #2 man in the design of the Perl 6 language.) He's also an active contributor to Perl 5, authoring more CPAN modules than you can comfortably shake a stick at, some being ridiculous (Coy, Acme::Bleach) while others are profound (Parse::RecDescent, Regexp::Common, Text::Balanced). He's a regular speaker at Perl and other IT conferences around the world, and a crowd favourite. His Perl books: "Perl Best Practices" http://www.oreilly.com/catalog/perlbp/ "Object Oriented Perl" http://www.manning.com/conway/ ////////////////////////////////// Any questions, comments, etc. -- just email me! Cheers, Richard From dmagnuszewski at mandtbank.com Mon Jul 3 10:53:59 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Mon, 03 Jul 2006 13:53:59 -0400 Subject: [Buffalo-pm] News and Upcoming Plans... Message-ID: Mongers, There are a few things to discuss... The first order of business is something we discussed at the June meeting, but I figured I'd officially send this out to the list for those who have missed the news: On June 18th (Father's day) Jim Brandt and his wife had triplets. They are Cameron (4 lbs. 6 oz.), Liam (4 lbs. 11 oz.), and Grace (5 lbs. 1 oz.). Congratulations to Jim and his wife, and best of luck. Hopefully he will be able to make an appearance every now and then at future meetings ;-) Who knows?! Maybe we'll have you attend meetings through the video iChat from now on! The next thing on the list is this month's meeting, which is scheduled for July 18th. With YAPC taking place last week, I think it would be a good idea, for those of us who attended, to give a talk on something they learned. This would be a benefit to those unable to attend. Ben/Kevin, does this sound good to you guys? That's all for now... -Dan From dmagnuszewski at mandtbank.com Thu Jul 6 11:34:01 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Thu, 06 Jul 2006 14:34:01 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command via Exec... Message-ID: Mongers, I am trying to grep from multiple files, named: messages, messages.0, messages.1, messages.2, etc. What I'd like to do is grep through all of these at once. The command to do this is: grep /var/adm/messages* So what I've tried doing is the following: my $wordToFind = 'router1'; open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", "/var/adm/messages*"); The asterisk seems to break, and I get no information. When I remove the asterisk: my $wordToFind = 'router1'; open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", "/var/adm/messages"); ...then everything works fine, but only greps through that one file. How can I declare a wildcard within this code - if at all? Thanks. -Dan From eye at buffalo.edu Thu Jul 6 11:42:32 2006 From: eye at buffalo.edu (Kevin Eye) Date: Thu, 06 Jul 2006 14:42:32 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command via Exec... In-Reply-To: Message-ID: This is a feature -- when you use more than one arg with system or exec, it doesn't send the arguments through the shell, so that things like spaces in filenames and maliciously coded input doing unexpected things. Wildcard expansion, IO redirection and other nifty things are done by the shell, though, so you don't get them anymore. One way to get the behavior you want would be to use one long string argument to exec like this: exec("/bin/grep $wordToFind /var/adm/messages*"); That will run it though the shell, expanding the wildcard, but also possibly doing very bad things if $wordToFind isn't always safely escaped. A better way is to use the glob function, which expands asterisks on file names. Try this: exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); - Kevin On 7/6/06 2:34 PM, "DANIEL MAGNUSZEWSKI" wrote: > Mongers, > > I am trying to grep from multiple files, named: messages, messages.0, > messages.1, messages.2, etc. What I'd like to do is grep through all of > these at once. The command to do this is: > > grep /var/adm/messages* > > So what I've tried doing is the following: > > my $wordToFind = 'router1'; > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > "/var/adm/messages*"); > > The asterisk seems to break, and I get no information. When I remove > the asterisk: > > my $wordToFind = 'router1'; > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > "/var/adm/messages"); > > ...then everything works fine, but only greps through that one file. > How can I declare a wildcard within this code - if at all? > > Thanks. > > -Dan > > _______________________________________________ > Buffalo Perl Mongers Homepage > http://buffalo.pm.org > > Buffalo-pm mailing list > Buffalo-pm at pm.org > http://mail.pm.org/mailman/listinfo/buffalo-pm -- Kevin Eye Web Applications Developer Marketing and Creative Services University at Buffalo 330 Crofts Hall Buffalo, NY 14260 eye at buffalo.edu phone (716) 645-5000 x1435 fax (716) 645-3765 From dmagnuszewski at mandtbank.com Thu Jul 6 12:28:45 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Thu, 06 Jul 2006 15:28:45 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command via Exec... Message-ID: Yeah, I'm trying to not run it through the shell, as it's a CGI application... I tried the: exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); ...but it didn't work. Do I need to include "use File::Glob ':glob';"? This is running on a solaris 8 machine. Thoughts? >>> "Kevin Eye" 07/06/06 2:42 PM >>> This is a feature -- when you use more than one arg with system or exec, it doesn't send the arguments through the shell, so that things like spaces in filenames and maliciously coded input doing unexpected things. Wildcard expansion, IO redirection and other nifty things are done by the shell, though, so you don't get them anymore. One way to get the behavior you want would be to use one long string argument to exec like this: exec("/bin/grep $wordToFind /var/adm/messages*"); That will run it though the shell, expanding the wildcard, but also possibly doing very bad things if $wordToFind isn't always safely escaped. A better way is to use the glob function, which expands asterisks on file names. Try this: exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); - Kevin On 7/6/06 2:34 PM, "DANIEL MAGNUSZEWSKI" wrote: > Mongers, > > I am trying to grep from multiple files, named: messages, messages.0, > messages.1, messages.2, etc. What I'd like to do is grep through all of > these at once. The command to do this is: > > grep /var/adm/messages* > > So what I've tried doing is the following: > > my $wordToFind = 'router1'; > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > "/var/adm/messages*"); > > The asterisk seems to break, and I get no information. When I remove > the asterisk: > > my $wordToFind = 'router1'; > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > "/var/adm/messages"); > > ...then everything works fine, but only greps through that one file. > How can I declare a wildcard within this code - if at all? > > Thanks. > > -Dan > > _______________________________________________ > Buffalo Perl Mongers Homepage > http://buffalo.pm.org > > Buffalo-pm mailing list > Buffalo-pm at pm.org > http://mail.pm.org/mailman/listinfo/buffalo-pm -- Kevin Eye Web Applications Developer Marketing and Creative Services University at Buffalo 330 Crofts Hall Buffalo, NY 14260 eye at buffalo.edu phone (716) 645-5000 x1435 fax (716) 645-3765 From dmagnuszewski at mandtbank.com Thu Jul 6 12:35:54 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Thu, 06 Jul 2006 15:35:54 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command viaExec... Message-ID: P.S - I am using the following regex to certify the input as valid: $cgi->param('host') =~ /^[\w\d\-]+$/ ...would this make it safe to pass through the shell? Or is there still a way to circumvent this input check? -Dan >>> "DANIEL MAGNUSZEWSKI" 07/06/06 3:28 PM >>> Yeah, I'm trying to not run it through the shell, as it's a CGI application... I tried the: exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); ...but it didn't work. Do I need to include "use File::Glob ':glob';"? This is running on a solaris 8 machine. Thoughts? >>> "Kevin Eye" 07/06/06 2:42 PM >>> This is a feature -- when you use more than one arg with system or exec, it doesn't send the arguments through the shell, so that things like spaces in filenames and maliciously coded input doing unexpected things. Wildcard expansion, IO redirection and other nifty things are done by the shell, though, so you don't get them anymore. One way to get the behavior you want would be to use one long string argument to exec like this: exec("/bin/grep $wordToFind /var/adm/messages*"); That will run it though the shell, expanding the wildcard, but also possibly doing very bad things if $wordToFind isn't always safely escaped. A better way is to use the glob function, which expands asterisks on file names. Try this: exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); - Kevin On 7/6/06 2:34 PM, "DANIEL MAGNUSZEWSKI" wrote: > Mongers, > > I am trying to grep from multiple files, named: messages, messages.0, > messages.1, messages.2, etc. What I'd like to do is grep through all of > these at once. The command to do this is: > > grep /var/adm/messages* > > So what I've tried doing is the following: > > my $wordToFind = 'router1'; > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > "/var/adm/messages*"); > > The asterisk seems to break, and I get no information. When I remove > the asterisk: > > my $wordToFind = 'router1'; > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > "/var/adm/messages"); > > ...then everything works fine, but only greps through that one file. > How can I declare a wildcard within this code - if at all? > > Thanks. > > -Dan > > _______________________________________________ > Buffalo Perl Mongers Homepage > http://buffalo.pm.org > > Buffalo-pm mailing list > Buffalo-pm at pm.org > http://mail.pm.org/mailman/listinfo/buffalo-pm -- Kevin Eye Web Applications Developer Marketing and Creative Services University at Buffalo 330 Crofts Hall Buffalo, NY 14260 eye at buffalo.edu phone (716) 645-5000 x1435 fax (716) 645-3765 _______________________________________________ Buffalo Perl Mongers Homepage http://buffalo.pm.org Buffalo-pm mailing list Buffalo-pm at pm.org http://mail.pm.org/mailman/listinfo/buffalo-pm From eye at buffalo.edu Thu Jul 6 13:20:57 2006 From: eye at buffalo.edu (Kevin Eye) Date: Thu, 06 Jul 2006 16:20:57 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command viaExec... In-Reply-To: Message-ID: > P.S - I am using the following regex to certify the input as valid: > > $cgi->param('host') =~ /^[\w\d\-]+$/ That looks good. I can't think of a way for special shell characters to slip through that. > I tried the: > > exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); > > ...but it didn't work. Do I need to include "use File::Glob ':glob';"? > This is running on a solaris 8 machine. Not sure why it doesn't work. I've never used File::Glob; just the built-in glob. When I say: print join("\n", glob "/*"); I get lots of directories and files at the root of my system. Do you? I'm not sure what would be wrong. - Kevin >>>> "Kevin Eye" 07/06/06 2:42 PM >>> > This is a feature -- when you use more than one arg with system or > exec, it > doesn't send the arguments through the shell, so that things like > spaces in > filenames and maliciously coded input doing unexpected things. > Wildcard > expansion, IO redirection and other nifty things are done by the > shell, > though, so you don't get them anymore. > > One way to get the behavior you want would be to use one long string > argument to exec like this: > exec("/bin/grep $wordToFind /var/adm/messages*"); > > That will run it though the shell, expanding the wildcard, but also > possibly > doing very bad things if $wordToFind isn't always safely escaped. > > A better way is to use the glob function, which expands asterisks on > file > names. Try this: > exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); > > - Kevin > > > On 7/6/06 2:34 PM, "DANIEL MAGNUSZEWSKI" > wrote: > >> Mongers, >> >> I am trying to grep from multiple files, named: messages, > messages.0, >> messages.1, messages.2, etc. What I'd like to do is grep through all > of >> these at once. The command to do this is: >> >> grep /var/adm/messages* >> >> So what I've tried doing is the following: >> >> my $wordToFind = 'router1'; >> open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", >> "/var/adm/messages*"); >> >> The asterisk seems to break, and I get no information. When I remove >> the asterisk: >> >> my $wordToFind = 'router1'; >> open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", >> "/var/adm/messages"); >> >> ...then everything works fine, but only greps through that one file. >> How can I declare a wildcard within this code - if at all? >> >> Thanks. >> >> -Dan >> >> _______________________________________________ >> Buffalo Perl Mongers Homepage >> http://buffalo.pm.org >> >> Buffalo-pm mailing list >> Buffalo-pm at pm.org >> http://mail.pm.org/mailman/listinfo/buffalo-pm -- Kevin Eye Web Applications Developer Marketing and Creative Services University at Buffalo 330 Crofts Hall Buffalo, NY 14260 eye at buffalo.edu phone (716) 645-5000 x1435 fax (716) 645-3765 From bennymack at gmail.com Thu Jul 6 13:23:29 2006 From: bennymack at gmail.com (Ben. B.) Date: Thu, 6 Jul 2006 16:23:29 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command viaExec... In-Reply-To: References: Message-ID: My thoughts would be that the exec doesn't return anything meaningful so you'll need a way to capture the output to send to the browser. The glob() function is synonymous with the <*> syntax but the <*> is only available on later Perl's so use glob() to be sure. My example, though meant to be run on the command line, should be adaptable to a CGI script. That way you can get the output from the $grep handle. Regarding your regex, I'd say also remove newlines and carriage returns: $cgi->param('host') =~ /[^\w\d\-]/sg; Might do it? On 7/6/06, DANIEL MAGNUSZEWSKI wrote: > P.S - I am using the following regex to certify the input as valid: > > $cgi->param('host') =~ /^[\w\d\-]+$/ > > ...would this make it safe to pass through the shell? Or is there still > a way to circumvent this input check? > > -Dan > > >>> "DANIEL MAGNUSZEWSKI" 07/06/06 3:28 > PM >>> > Yeah, I'm trying to not run it through the shell, as it's a CGI > application... > > I tried the: > > exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); > > ...but it didn't work. Do I need to include "use File::Glob ':glob';"? > This is running on a solaris 8 machine. > > Thoughts? > > > >>> "Kevin Eye" 07/06/06 2:42 PM >>> > This is a feature -- when you use more than one arg with system or > exec, it > doesn't send the arguments through the shell, so that things like > spaces in > filenames and maliciously coded input doing unexpected things. > Wildcard > expansion, IO redirection and other nifty things are done by the > shell, > though, so you don't get them anymore. > > One way to get the behavior you want would be to use one long string > argument to exec like this: > exec("/bin/grep $wordToFind /var/adm/messages*"); > > That will run it though the shell, expanding the wildcard, but also > possibly > doing very bad things if $wordToFind isn't always safely escaped. > > A better way is to use the glob function, which expands asterisks on > file > names. Try this: > exec ("/bin/grep", "$wordToFind", glob "/var/adm/messages*"); > > - Kevin > > > On 7/6/06 2:34 PM, "DANIEL MAGNUSZEWSKI" > wrote: > > > Mongers, > > > > I am trying to grep from multiple files, named: messages, > messages.0, > > messages.1, messages.2, etc. What I'd like to do is grep through all > of > > these at once. The command to do this is: > > > > grep /var/adm/messages* > > > > So what I've tried doing is the following: > > > > my $wordToFind = 'router1'; > > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > > "/var/adm/messages*"); > > > > The asterisk seems to break, and I get no information. When I remove > > the asterisk: > > > > my $wordToFind = 'router1'; > > open (PROGRAM, "-|") or exec ("/bin/grep", "$wordToFind", > > "/var/adm/messages"); > > > > ...then everything works fine, but only greps through that one file. > > How can I declare a wildcard within this code - if at all? > > > > Thanks. > > > > -Dan > > > > _______________________________________________ > > Buffalo Perl Mongers Homepage > > http://buffalo.pm.org > > > > Buffalo-pm mailing list > > Buffalo-pm at pm.org > > http://mail.pm.org/mailman/listinfo/buffalo-pm > > -- > Kevin Eye > Web Applications Developer > Marketing and Creative Services > University at Buffalo > 330 Crofts Hall > Buffalo, NY 14260 > eye at buffalo.edu > phone (716) 645-5000 x1435 > fax (716) 645-3765 > > > > > _______________________________________________ > Buffalo Perl Mongers Homepage > http://buffalo.pm.org > > Buffalo-pm mailing list > Buffalo-pm at pm.org > http://mail.pm.org/mailman/listinfo/buffalo-pm > > > _______________________________________________ > Buffalo Perl Mongers Homepage > http://buffalo.pm.org > > Buffalo-pm mailing list > Buffalo-pm at pm.org > http://mail.pm.org/mailman/listinfo/buffalo-pm > From dmagnuszewski at mandtbank.com Thu Jul 6 13:31:23 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Thu, 06 Jul 2006 16:31:23 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command viaExec... Message-ID: It works, but for some reason it's not grep'ing through all the files. Do I need to modify the open/exec call to something like this: open (PROGRAM, "-|") or foreach (glob "/var/adm/messages*") { exec ("/bin/grep", "$host", "$_") }; >>> "Kevin Eye" 07/06/06 4:20 PM >>> When I say: print join("\n", glob "/*"); I get lots of directories and files at the root of my system. Do you? I'm not sure what would be wrong. - Kevin From dmagnuszewski at mandtbank.com Thu Jul 6 13:35:12 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Thu, 06 Jul 2006 16:35:12 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running Command viaExec... Message-ID: I can't get your 'one-liner' to return anything, which is odd. >>> "Ben. B." 07/06/06 4:23 PM >>> My thoughts would be that the exec doesn't return anything meaningful so you'll need a way to capture the output to send to the browser. The glob() function is synonymous with the <*> syntax but the <*> is only available on later Perl's so use glob() to be sure. My example, though meant to be run on the command line, should be adaptable to a CGI script. That way you can get the output from the $grep handle. Regarding your regex, I'd say also remove newlines and carriage returns: $cgi->param('host') =~ /[^\w\d\-]/sg; Might do it? From dmagnuszewski at mandtbank.com Fri Jul 7 07:54:03 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Fri, 07 Jul 2006 10:54:03 -0400 Subject: [Buffalo-pm] Asterisk Wildcard When Running CommandviaExec... Message-ID: That didn't return anything for me, but I changed it around to: open( PROGRAM, '-|') or exec('/bin/grep', $host, glob '/var/adm/messages*'); ...and it worked! I had to break the open apart with exec (similar to how it was before). I wonder if it was a matter of the single and double quotes after glob? Thanks for the help! -Dan >>> "Ben. B." 07/06/06 5:19 PM >>> Hey, I got it to work on a linux server with this line: open( PROGRAM, '-|', '/bin/grep', $host, glob '/var/adm/messages*' ); The open or foreach was coming up as a syntax error too. I had to print the values directly because the regex was failing but it worked otherwise. Let me know if that works for ya. Ben On 7/6/06, DANIEL MAGNUSZEWSKI wrote: > Here it is: > > #!/usr/bin/perl > use strict; > > $|++; > > use CGI; > my $cgi = new CGI; > > if (!$cgi->param) > { > print_header(); > print_default_page(); > print_end_html(); > } > elsif ($cgi->param('host') =~ /^[\w\d\-]+$/) > { > get_syslog_data(lc($cgi->param('host'))); > print "

"; > print_default_page(); > print_end_html(); > } > else > { > my $msg = ' ' . $cgi->param('host') . ' ' . " Is An > Incorrect Hostname! " . '

'; > print_error_page($msg); > print_end_html(); > } > > ############### > # SUBROUTINES # > ############### > > sub get_syslog_data > { > my $host = shift; > my $color = 0; > my @color = qw(FFFFCC white); > > open (PROGRAM, "-|") > or foreach (glob "/var/adm/messages*") { exec > ("/bin/grep", "$host", "$_") }; > # or exec ("/bin/grep $host /var/adm/messages*"); > # or exec ("/bin/grep", "$host", "/var/adm/messages"); > > print "PROGRAM Length: " . length(); > > if (length() == 0) > { > print "LINE: $_"; > print_header(); > print 'There are no syslog messages > for ' . $host . '!

'; > print_default_page(); > exit; > } > else { print_header(); } > > print $cgi->start_table({-border=>'1', -cellpadding=>'3', > -bgcolor=>'gray'}); > print $cgi->Tr({-align=>'left', -bgcolor=>'66CCFF'}, > [$cgi->th(['Time', 'Device', 'Syslog Message'])]); > > while () > { > if ($color == 1) { $color--; } > else {$color++; }; > > > /:([A-Za-z]{3}\s{1,2}\d{1,2}\s\d+\:\d+\:\d+)\s([\w\d\-]+\.[\w\d\-]+\.[\w\d\-]+)\s(.+)$/; > > print $cgi->Tr({-align=>'left', > -bgcolor=>"$color[$color]"}, [$cgi->td(["$1", "$2", "$3"])]); > } > } > > sub print_header > { > print $cgi->header; > print $cgi->start_html("M&T Bank - Syslog Report Generator"); > } > > sub print_default_page > { > print "Enter The Device's Name: "; > print $cgi->start_form(); > print $cgi->textfield( > -name=>'host', > -size=>25, > -maxlength=>80 > ); > print $cgi->p; > print $cgi->submit(-value=>'Find Syslogs'); > print $cgi->end_form(); > > } > > sub print_error_page > { > my $error_msg = shift; > print_header(); > print 'ERROR: ' . $error_msg . ''; > print_default_page(); > print_end_html(); > } > > sub print_end_html > { > print $cgi->end_html; > } > > > > >>> "Ben. B." 07/06/06 4:39 PM >>> > I'm pretty much stumped. Maybe it's something in the surrounding > program. Do you mind pasting all the code? > > Ben > > > > From dmagnuszewski at mandtbank.com Mon Jul 10 05:58:11 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Mon, 10 Jul 2006 08:58:11 -0400 Subject: [Buffalo-pm] Fwd: [pm_groups] Perl Monger t-shirts! I'm gathering orders now. Message-ID: Let me know if you are interested in ordering a shirt. -------------- next part -------------- An embedded message was scrubbed... From: "Jay Hannah" Subject: [pm_groups] Perl Monger t-shirts! I'm gathering orders now. Date: Sat, 08 Jul 2006 09:19:53 -0500 Size: 2552 Url: http://mail.pm.org/pipermail/buffalo-pm/attachments/20060710/afe5d773/attachment.mht From dmagnuszewski at mandtbank.com Wed Jul 12 09:07:37 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Wed, 12 Jul 2006 12:07:37 -0400 Subject: [Buffalo-pm] Pittsburgh Perl Workshop - Saturday September 23, 2006 Message-ID: Mongers, "The Pittsburgh Perl Workshop is a low cost, one day conference to be held in the University Center on Carnegie Mellon University's Oakland Campus. The workshop is scheduled for September 23 2006." http://pghpw.org I just thought some people may find this to be of interest. I am planning on going. Let me know if this sounds like something you'd be interested in - perhaps we can get a car-load to attend. The price is currently real cheap at $20 for non-student and $10 for students (http://pghpw.org/register.html). -Dan From dmagnuszewski at mandtbank.com Mon Jul 17 06:59:14 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Mon, 17 Jul 2006 09:59:14 -0400 Subject: [Buffalo-pm] REMINDER - July Perl Mongers Meeting Is Tomorrow! Message-ID: Topic: What I Learned On My YAPC Vacation... Date: Tuesday, July 18th, 2006 Time: 7:00 PM Location: Bell 242 (UB North Campus) This meeting will be a review of some topics covered at YAPC::NA 2006, from members who attended the conference. Regular Expressions Made Easy With Regexp::Common By: Dan Magnuszewski Do regular expressions scare or intimidate you?! I will show you an easy way to use elaborate regular expressions - without using regular expressions. Sounds crazy, but I'll show you how! With time permitting, I will also go over some basic hints/tricks to create regular expressions more efficiently! Perl::Critic By: Kevin Eye Perl-Critic is a source code analyzer that judges your code by the standards set by Damian Conway's book "Perl Best Practices". This was a module that was mentioned/recommended by Randal at last month's meeting. Open Systems By: Ben Bixby See you tomorrow! -Dan From dmagnuszewski at mandtbank.com Tue Jul 18 09:55:13 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Tue, 18 Jul 2006 12:55:13 -0400 Subject: [Buffalo-pm] REMINDER - July Perl Mongers Meeting Is TODAY! Message-ID: Topic: What I Learned On My YAPC Vacation... Date: Tuesday, July 18th, 2006 Time: 7:00 PM Location: Bell 242 (UB North Campus) This meeting will be a review of some topics covered at YAPC::NA 2006, from members who attended the conference. Regular Expressions Made Easy With Regexp::Common By: Dan Magnuszewski Do regular expressions scare or intimidate you?! I will show you an easy way to use elaborate regular expressions - without using regular expressions. Sounds crazy, but I'll show you how! With time permitting, I will also go over some basic hints/tricks to create regular expressions more efficiently! Perl::Critic By: Kevin Eye Perl-Critic is a source code analyzer that judges your code by the standards set by Damian Conway's book "Perl Best Practices". This was a module that was mentioned/recommended by Randal at last month's meeting. Open Systems By: Ben Bixby See you all tonight! -Dan From austin.frank at gmail.com Thu Jul 27 08:03:30 2006 From: austin.frank at gmail.com (Austin Frank) Date: Thu, 27 Jul 2006 11:03:30 -0400 Subject: [Buffalo-pm] new member! Message-ID: Hello all! My name is Austin Frank. I'm a grad student in the department of Brain and Cognitive Sciences at the University of Rochester. My specific field is psycholinguistics, and I do research on how people produce spoken and written language. I use perl for text mining, corpus analysis, some web stuff, prototyping computational models for my research, and for automating day-to-day tasks. I use SVK for version control and am talking to the Jifty folks about getting started on a web app related to a research project I've got going. I can be found on #perl6 from time to time, and have contributed a couple of grammars and some housecleaning-type fixes to Pugs. I live in Rochester, but am looking forward to attending future meetings in Buffalo. If there are any other Rochester folks on the list, feel free to contact me about carpooling to meetings. See you in August! /au From dmagnuszewski at mandtbank.com Thu Jul 27 08:37:55 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Thu, 27 Jul 2006 11:37:55 -0400 Subject: [Buffalo-pm] new member! Message-ID: Welcome Aboard! Department of Brain and Cognitive Sciences, huh?! I've recently become quite interested in brain functionality and human intelligence, after reading "On Intelligence" by Jeff Hawkins. It was a real interesting and thought provoking book on human intelligence and how to apply that to machine intelligence...But I digress. We look forward to seeing you in August. Feel free to offer up any topics that you'd like to see/give a talk on at an upcoming meeting. -Dan >>> "Austin Frank" 07/27/06 11:03 AM >>> Hello all! My name is Austin Frank. I'm a grad student in the department of Brain and Cognitive Sciences at the University of Rochester. My specific field is psycholinguistics, and I do research on how people produce spoken and written language. I use perl for text mining, corpus analysis, some web stuff, prototyping computational models for my research, and for automating day-to-day tasks. I use SVK for version control and am talking to the Jifty folks about getting started on a web app related to a research project I've got going. I can be found on #perl6 from time to time, and have contributed a couple of grammars and some housecleaning-type fixes to Pugs. I live in Rochester, but am looking forward to attending future meetings in Buffalo. If there are any other Rochester folks on the list, feel free to contact me about carpooling to meetings. See you in August! /au _______________________________________________ Buffalo Perl Mongers Homepage http://buffalo.pm.org Buffalo-pm mailing list Buffalo-pm at pm.org http://mail.pm.org/mailman/listinfo/buffalo-pm From eye at buffalo.edu Thu Jul 27 09:14:48 2006 From: eye at buffalo.edu (Kevin Eye) Date: Thu, 27 Jul 2006 12:14:48 -0400 Subject: [Buffalo-pm] new member! In-Reply-To: Message-ID: > Feel free to offer up any > topics that you'd like to see/give a talk on at an upcoming meeting. BTW, I had an idea for a talk. Back in 2000, Damian Conway closed out YAPC::NA::19100 (an homage to the Y2K bug) with a mind blowing talk and module about "quantum superpositions." The module (Quantum::Superpositions -- it's on CPAN) simulates what quantum computing will be like, allowing massively parallel computations with single operations. The module isn't all that useful for everyday things, but it illustrates some fascinating concepts and completely different ways to look at things. Anyways, I think I could do an hour or so on an intro to quantum mechanics, qubits, quantum supercomputing, and the Quantum::Superpositions module. Maybe next month, or some other time. - Kevin -- Kevin Eye Web Applications Developer Marketing and Creative Services University at Buffalo 330 Crofts Hall Buffalo, NY 14260 eye at buffalo.edu phone (716) 645-5000 x1435 fax (716) 645-3765 From dmagnuszewski at mandtbank.com Thu Jul 27 10:04:49 2006 From: dmagnuszewski at mandtbank.com (DANIEL MAGNUSZEWSKI) Date: Thu, 27 Jul 2006 13:04:49 -0400 Subject: [Buffalo-pm] new member! Message-ID: I remember you mentioning this after the July meeting. It definitely sounds like an interesting talk. I can put you into the slot for the August meeting, and maybe we can get someone to do a beginner topic as well (is anyone good with pack/unpack?). -Dan >>> "Kevin Eye" 07/27/06 12:14 PM >>> > Feel free to offer up any > topics that you'd like to see/give a talk on at an upcoming meeting. BTW, I had an idea for a talk. Back in 2000, Damian Conway closed out YAPC::NA::19100 (an homage to the Y2K bug) with a mind blowing talk and module about "quantum superpositions." The module (Quantum::Superpositions -- it's on CPAN) simulates what quantum computing will be like, allowing massively parallel computations with single operations. The module isn't all that useful for everyday things, but it illustrates some fascinating concepts and completely different ways to look at things. Anyways, I think I could do an hour or so on an intro to quantum mechanics, qubits, quantum supercomputing, and the Quantum::Superpositions module. Maybe next month, or some other time. - Kevin -- Kevin Eye Web Applications Developer Marketing and Creative Services University at Buffalo 330 Crofts Hall Buffalo, NY 14260 eye at buffalo.edu phone (716) 645-5000 x1435 fax (716) 645-3765 From cbrandt at buffalo.edu Mon Jul 31 05:17:24 2006 From: cbrandt at buffalo.edu (Jim Brandt) Date: Mon, 31 Jul 2006 08:17:24 -0400 Subject: [Buffalo-pm] new member! In-Reply-To: References: Message-ID: <44CDF4D4.50202@buffalo.edu> Welcome, Austin! I think there was once a Rochester perl mongers group started by some students at RIT, but it has since gone quiet. Looks like the last active meetings were around 2001: http://rochester.pm.org/index.html Jim Austin Frank wrote: > Hello all! > > My name is Austin Frank. I'm a grad student in the department of > Brain and Cognitive Sciences at the University of Rochester. My > specific field is psycholinguistics, and I do research on how people > produce spoken and written language. > > I use perl for text mining, corpus analysis, some web stuff, > prototyping computational models for my research, and for automating > day-to-day tasks. I use SVK for version control and am talking to the > Jifty folks about getting started on a web app related to a research > project I've got going. I can be found on #perl6 from time to time, > and have contributed a couple of grammars and some housecleaning-type > fixes to Pugs. > > I live in Rochester, but am looking forward to attending future > meetings in Buffalo. If there are any other Rochester folks on the > list, feel free to contact me about carpooling to meetings. > > See you in August! > /au > _______________________________________________ > Buffalo Perl Mongers Homepage > http://buffalo.pm.org > > Buffalo-pm mailing list > Buffalo-pm at pm.org > http://mail.pm.org/mailman/listinfo/buffalo-pm -- Jim Brandt Administrative Computing Services University at Buffalo From jkeen at verizon.net Mon Jul 31 19:20:47 2006 From: jkeen at verizon.net (James Keenan) Date: Mon, 31 Jul 2006 22:20:47 -0400 Subject: [Buffalo-pm] new member! In-Reply-To: <44CDF4D4.50202@buffalo.edu> References: <44CDF4D4.50202@buffalo.edu> Message-ID: <71718AFA-05EB-4479-89AF-BD5031E046CB@verizon.net> On Jul 31, 2006, at 8:17 AM, Jim Brandt wrote: > Welcome, Austin! > > I think there was once a Rochester perl mongers group started by some > students at RIT, but it has since gone quiet. > > Looks like the last active meetings were around 2001: > Rochester is my city of birth and I come through there several times a year ... sometimes en route to Buffalo or Toronto!. In May 2005 I posted on the Rochester.pm list to see about meeting up with some people for some brew on my way to YAPC::Toronto the following month. For all practical purposes, I got no response, and I think I was the last person to post on that list. There were, however, a couple of people from Rochester who had attended YAPC::Buffalo the previous year. And I've met someone from Cornell a couple of times at YAPC. Austin: When I'm next headed toward Rochester, I'll email you in advance. Jim Keenan Brooklyn NY