From djgoku at gmail.com Wed Mar 7 10:40:42 2012 From: djgoku at gmail.com (Jonathan Otsuka) Date: Wed, 7 Mar 2012 12:40:42 -0600 Subject: [Kc] say STDOUT and warn STDERR Message-ID: I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? Jonathan Otsuka From rsaxvc at gmail.com Wed Mar 7 10:48:38 2012 From: rsaxvc at gmail.com (Richard Allen) Date: Wed, 7 Mar 2012 12:48:38 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: References: Message-ID: You could pipe stderr in the shell seperatelyfrom stdout, but you can also redirect it in perl http://www.cs.cmu.edu/afs/cs/usr/rgs/mosaic/pl-exp-io.html The second codesnippet under open has an example On Mar 7, 2012 12:41 PM, "Jonathan Otsuka" wrote: > I have a program that process/format a file then prints to STDOUT which I > may want to save/redirect to a file. I also create a report of the data > that was processed, but I don't want the report output sent to STDOUT and > was thinking of using warn since its output is to STDERR. Is there another > way or is this the best way? > > Jonathan Otsuka > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ironicface at earthlink.net Wed Mar 7 10:48:36 2012 From: ironicface at earthlink.net (ironicface at earthlink.net) Date: Wed, 7 Mar 2012 12:48:36 -0600 (GMT-06:00) Subject: [Kc] say STDOUT and warn STDERR Message-ID: <19945799.1331146117488.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net> Why do you not want to open a new file handle for the report? >Subject: [Kc] say STDOUT and warn STDERR > >I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? > >Jonathan Otsuka >_______________________________________________ >kc mailing list >kc at pm.org >http://mail.pm.org/mailman/listinfo/kc From chrisstinemetz at gmail.com Wed Mar 7 11:01:11 2012 From: chrisstinemetz at gmail.com (Chris Stinemetz) Date: Wed, 7 Mar 2012 13:01:11 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: References: Message-ID: On Wed, Mar 7, 2012 at 12:40 PM, Jonathan Otsuka wrote: > I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? > > Jonathan Otsuka > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc Why not open a filehandle to redirect the output? open my $out, '>', $output or die "Error opening $output: $!"; print $out .... "you fill in the blanks..." From djgoku at gmail.com Wed Mar 7 11:02:50 2012 From: djgoku at gmail.com (Jonathan Otsuka) Date: Wed, 7 Mar 2012 13:02:50 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: References: Message-ID: <3334BF9A-7C26-453C-B1E7-37D545CAE1F5@gmail.com> I want the user to choose what to do with STDOUT and STDERR on CLI. Jonathan Otsuka On Mar 7, 2012, at 12:48 PM, Richard Allen wrote: > You could pipe stderr in the shell seperatelyfrom stdout, but you can also redirect it in perl > > http://www.cs.cmu.edu/afs/cs/usr/rgs/mosaic/pl-exp-io.html > > The second codesnippet under open has an example > > On Mar 7, 2012 12:41 PM, "Jonathan Otsuka" wrote: > I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? > > Jonathan Otsuka > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc -------------- next part -------------- An HTML attachment was scrubbed... URL: From djgoku at gmail.com Wed Mar 7 11:04:36 2012 From: djgoku at gmail.com (Jonathan Otsuka) Date: Wed, 7 Mar 2012 13:04:36 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: <19945799.1331146117488.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net> References: <19945799.1331146117488.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net> Message-ID: <925AF8A6-397B-4193-922E-2B556605103A@gmail.com> Open a new file handle then redirect it to STDERR? Or do you mean to open a new handle and save the report? Jonathan Otsuka On Mar 7, 2012, at 12:48 PM, ironicface at earthlink.net wrote: > Why do you not want to open a new file handle for the report? > >> Subject: [Kc] say STDOUT and warn STDERR >> >> I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? >> >> Jonathan Otsuka >> _______________________________________________ >> kc mailing list >> kc at pm.org >> http://mail.pm.org/mailman/listinfo/kc > > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc From brian.hann at gmail.com Wed Mar 7 11:06:33 2012 From: brian.hann at gmail.com (Brian Hann) Date: Wed, 7 Mar 2012 13:06:33 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: <3334BF9A-7C26-453C-B1E7-37D545CAE1F5@gmail.com> References: <3334BF9A-7C26-453C-B1E7-37D545CAE1F5@gmail.com> Message-ID: If it's on the command line, you could use GetOpt::Long::Descriptive to set an optional filename argument for both the normal output and report output and then you wouldn't have to worry about wrangling output stream syntax when running the command. On Wed, Mar 7, 2012 at 1:02 PM, Jonathan Otsuka wrote: > I want the user to choose what to do with STDOUT and STDERR on CLI. > > Jonathan Otsuka > > On Mar 7, 2012, at 12:48 PM, Richard Allen wrote: > > You could pipe stderr in the shell seperatelyfrom stdout, but you can also > redirect it in perl > > http://www.cs.cmu.edu/afs/cs/usr/rgs/mosaic/pl-exp-io.html > > The second codesnippet under open has an example > On Mar 7, 2012 12:41 PM, "Jonathan Otsuka" wrote: > >> I have a program that process/format a file then prints to STDOUT which I >> may want to save/redirect to a file. I also create a report of the data >> that was processed, but I don't want the report output sent to STDOUT and >> was thinking of using warn since its output is to STDERR. Is there another >> way or is this the best way? >> >> Jonathan Otsuka >> _______________________________________________ >> kc mailing list >> kc at pm.org >> http://mail.pm.org/mailman/listinfo/kc >> > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc > > > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djgoku at gmail.com Wed Mar 7 11:09:21 2012 From: djgoku at gmail.com (Jonathan Otsuka) Date: Wed, 7 Mar 2012 13:09:21 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: References: Message-ID: $ script.pl Data1 Data2 Data3 Processed: 100 records $ script.pl > file Processed: 100 records Jonathan Otsuka On Mar 7, 2012, at 12:48 PM, Richard Allen wrote: > You could pipe stderr in the shell seperatelyfrom stdout, but you can also redirect it in perl > > http://www.cs.cmu.edu/afs/cs/usr/rgs/mosaic/pl-exp-io.html > > The second codesnippet under open has an example > > On Mar 7, 2012 12:41 PM, "Jonathan Otsuka" wrote: > I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? > > Jonathan Otsuka > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc -------------- next part -------------- An HTML attachment was scrubbed... URL: From djgoku at gmail.com Wed Mar 7 11:53:39 2012 From: djgoku at gmail.com (Jonathan Otsuka) Date: Wed, 7 Mar 2012 13:53:39 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: References: <3334BF9A-7C26-453C-B1E7-37D545CAE1F5@gmail.com> Message-ID: I am using getopt::long so I could add another parameter, but sometimes I want to see the data before I save it to a file. I think I am going to change lines that I want to output to the screen if I redirect STDOUT or not to: # since STDERR filehandle is already open for us print STDERR "blah"; Instead of using: warn "blah"; Jonathan Otsuka On Mar 7, 2012, at 1:06 PM, Brian Hann wrote: > If it's on the command line, you could use GetOpt::Long::Descriptive to set an optional filename argument for both the normal output and report output and then you wouldn't have to worry about wrangling output stream syntax when running the command. > > On Wed, Mar 7, 2012 at 1:02 PM, Jonathan Otsuka wrote: > I want the user to choose what to do with STDOUT and STDERR on CLI. > > Jonathan Otsuka > > On Mar 7, 2012, at 12:48 PM, Richard Allen wrote: > >> You could pipe stderr in the shell seperatelyfrom stdout, but you can also redirect it in perl >> >> http://www.cs.cmu.edu/afs/cs/usr/rgs/mosaic/pl-exp-io.html >> >> The second codesnippet under open has an example >> >> On Mar 7, 2012 12:41 PM, "Jonathan Otsuka" wrote: >> I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? >> >> Jonathan Otsuka >> _______________________________________________ >> kc mailing list >> kc at pm.org >> http://mail.pm.org/mailman/listinfo/kc >> _______________________________________________ >> kc mailing list >> kc at pm.org >> http://mail.pm.org/mailman/listinfo/kc > > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc > > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc -------------- next part -------------- An HTML attachment was scrubbed... URL: From ironicface at earthlink.net Wed Mar 7 12:11:04 2012 From: ironicface at earthlink.net (ironicface at earthlink.net) Date: Wed, 7 Mar 2012 14:11:04 -0600 (GMT-06:00) Subject: [Kc] say STDOUT and warn STDERR Message-ID: <24844325.1331151064816.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net> An HTML attachment was scrubbed... URL: From chrisstinemetz at gmail.com Wed Mar 7 12:14:43 2012 From: chrisstinemetz at gmail.com (Chris Stinemetz) Date: Wed, 7 Mar 2012 14:14:43 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: References: <3334BF9A-7C26-453C-B1E7-37D545CAE1F5@gmail.com> Message-ID: On Wed, Mar 7, 2012 at 1:53 PM, Jonathan Otsuka wrote: > I am using getopt::long so I could add another parameter, but sometimes I > want to see the data before I save it to a file. > > I think I am going to change lines that I want to output to the screen if I > redirect STDOUT or not to: > > # since STDERR filehandle is already open for us > print STDERR "blah"; > > Instead of using: > > warn "blah"; > > Jonathan Otsuka This is how I would handle it without using getopt modules. use warnings; use strict; my $OUTPUT; my $outFile = "out.txt"; print "Would you like STDOUT and STDERR on CLI? \[yes no\]\n"; while ( $OUTPUT = ) { if ( $OUTPUT =~ /[yY]es/ ) { $OUTPUT = 1; last; } if ( $OUTPUT =~ /[nN]o/ ) { $OUTPUT = 0; last; } } open my $out,'>',$outFile or die "ERROR opening $outFile: $!" if $OUTPUT == 0; print "STDOUT and STDERR you chose Yes\n" if $OUTPUT == 1; print $out "You chose No\n" if $OUTPUT == 0; print "Check the file out.txt\n" if $OUTPUT == 0; From djgoku at gmail.com Wed Mar 7 12:30:28 2012 From: djgoku at gmail.com (Jonathan Otsuka) Date: Wed, 7 Mar 2012 14:30:28 -0600 Subject: [Kc] say STDOUT and warn STDERR In-Reply-To: <24844325.1331151064816.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net> References: <24844325.1331151064816.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net> Message-ID: The data file read is usually megabytes in size I keep all off the data and that would eat up a lot of RAM. I like that idea though if it was a smaller data set. Jonathan Otsuka On Mar 7, 2012, at 2:11 PM, ironicface at earthlink.net wrote: > Ok, I think I understand better now. > > Since STDERR AND STDOUT both just direct to the console, and you essentially want the work to be saved, > why not open a file handle for the work (and maybe one for the report), and use STDOUT with some interface > questions (# Review report data (y/n)), to preview the report before you save anything. > (I.e., send the report to STDOUT before saving a copy of it to the file handle) > Then have a followup interface question to save or abort, or whatever seems appropriate. > > Teal > > -----Original Message----- > From: Jonathan Otsuka > Sent: Mar 7, 2012 1:53 PM > To: "Kansas City Perl Mongers (kc.pm)" > Subject: Re: [Kc] say STDOUT and warn STDERR > > I am using getopt::long so I could add another parameter, but sometimes I want to see the data before I save it to a file. > > I think I am going to change lines that I want to output to the screen if I redirect STDOUT or not to: > > # since STDERR filehandle is already open for us > print STDERR "blah"; > > Instead of using: > > warn "blah"; > > Jonathan Otsuka > > On Mar 7, 2012, at 1:06 PM, Brian Hann wrote: > >> If it's on the command line, you could use GetOpt::Long::Descriptive to set an optional filename argument for both the normal output and report output and then you wouldn't have to worry about wrangling output stream syntax when running the command. >> >> On Wed, Mar 7, 2012 at 1:02 PM, Jonathan Otsuka wrote: >> I want the user to choose what to do with STDOUT and STDERR on CLI. >> >> Jonathan Otsuka >> >> On Mar 7, 2012, at 12:48 PM, Richard Allen wrote: >> >>> You could pipe stderr in the shell seperatelyfrom stdout, but you can also redirect it in perl >>> http://www.cs.cmu.edu/afs/cs/usr/rgs/mosaic/pl-exp-io.html >>> The second codesnippet under open has an example >>> On Mar 7, 2012 12:41 PM, "Jonathan Otsuka" wrote: >>> I have a program that process/format a file then prints to STDOUT which I may want to save/redirect to a file. I also create a report of the data that was processed, but I don't want the report output sent to STDOUT and was thinking of using warn since its output is to STDERR. Is there another way or is this the best way? >>> >>> Jonathan Otsuka >>> _______________________________________________ >>> kc mailing list >>> kc at pm.org >>> http://mail.pm.org/mailman/listinfo/kc >>> _______________________________________________ >>> kc mailing list >>> kc at pm.org >>> http://mail.pm.org/mailman/listinfo/kc >> >> _______________________________________________ >> kc mailing list >> kc at pm.org >> http://mail.pm.org/mailman/listinfo/kc >> >> _______________________________________________ >> kc mailing list >> kc at pm.org >> http://mail.pm.org/mailman/listinfo/kc > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc -------------- next part -------------- An HTML attachment was scrubbed... URL: From danny at drungilas.com Wed Mar 7 12:50:21 2012 From: danny at drungilas.com (Danny Drungilas) Date: Wed, 7 Mar 2012 14:50:21 -0600 Subject: [Kc] unsubscribe Message-ID: <005f01ccfca3$ead5a300$c080e900$@com> danny at drungilas.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From djgoku at gmail.com Sun Mar 11 21:20:26 2012 From: djgoku at gmail.com (Jonathan Otsuka) Date: Sun, 11 Mar 2012 23:20:26 -0500 Subject: [Kc] March 2012 Meeting Message-ID: <39351BD6-0DB1-4405-B1E4-EE065B8BC085@gmail.com> Anyone interested in meeting on Tuesday? I wonder if the expansion is done yet. Jonathan From amoore at mooresystems.com Mon Mar 12 11:41:55 2012 From: amoore at mooresystems.com (Andrew Moore) Date: Mon, 12 Mar 2012 13:41:55 -0500 Subject: [Kc] March 2012 Meeting In-Reply-To: <39351BD6-0DB1-4405-B1E4-EE065B8BC085@gmail.com> References: <39351BD6-0DB1-4405-B1E4-EE065B8BC085@gmail.com> Message-ID: You bet! Thanks for the reminder! I've played around with building a catalyst app on dotcloud.com this month, so I could share some experiences with plack on dotcloud if anyone is interested in hearing them. I'd also love to hear if there's a cheaper alternative that's worth trying out. see you tomorrow evening! -Andy On Sun, Mar 11, 2012 at 11:20 PM, Jonathan Otsuka wrote: > Anyone interested in meeting on Tuesday? I wonder if the expansion is done yet. > > Jonathan > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc From amoore at mooresystems.com Mon Mar 12 11:47:31 2012 From: amoore at mooresystems.com (Andrew Moore) Date: Mon, 12 Mar 2012 13:47:31 -0500 Subject: [Kc] March 2012 Meeting In-Reply-To: References: <39351BD6-0DB1-4405-B1E4-EE065B8BC085@gmail.com> Message-ID: Ooops! Barleys is closed for reconstruction until the end of the month. I'll find a reasonable substitute and get an update out to the list this afternoon. In the meantime, if anyone has any suggestions, please let me know. -Andy From amoore at mooresystems.com Mon Mar 12 12:45:03 2012 From: amoore at mooresystems.com (Andrew Moore) Date: Mon, 12 Mar 2012 14:45:03 -0500 Subject: [Kc] KC Perl mongers March meeting MOVED to 75th Street Brewery in Waldo Message-ID: Jonathan reminds me that tomorrow is the 2nd Tuesday in March, so it's time for the KC Perl Mongers meeting. Our regular location is closed this month, so we're meeting at 75th Street Brewery in Waldo instead. It's one block West of Wornall on 75th Street. We'll get together at the regular time: 7pm. I've been building a catalyst application on dotcloud.com this month and can chat about deploying plack applications on dotcloud. I'd also love to hear about any cheaper alternatives if anyone has experience with them. Jonathan says he has some questions about database access from a piece of code and will bring it to discuss. Please let me know if you're going to make it, and if enough folks are coming, I'll call to reserve the back room. I look forward to seeing you there! -Andy From davidnicol at gmail.com Mon Mar 12 13:11:59 2012 From: davidnicol at gmail.com (David Nicol) Date: Mon, 12 Mar 2012 15:11:59 -0500 Subject: [Kc] March 2012 Meeting In-Reply-To: References: <39351BD6-0DB1-4405-B1E4-EE065B8BC085@gmail.com> Message-ID: $0/month is tough to beat, pricing-wise. They charge by the service. What's a "service?" On Mon, Mar 12, 2012 at 1:41 PM, Andrew Moore wrote: > You bet! Thanks for the reminder! > > I've played around with building a catalyst app on dotcloud.com this > month, so I could share some experiences with plack on dotcloud if > anyone is interested in hearing them. I'd also love to hear if there's > a cheaper alternative that's worth trying out. > > see you tomorrow evening! > -Andy > > > On Sun, Mar 11, 2012 at 11:20 PM, Jonathan Otsuka > wrote: > > Anyone interested in meeting on Tuesday? I wonder if the expansion is > done yet. > > > > Jonathan > > _______________________________________________ > > kc mailing list > > kc at pm.org > > http://mail.pm.org/mailman/listinfo/kc > _______________________________________________ > kc mailing list > kc at pm.org > http://mail.pm.org/mailman/listinfo/kc > -- maybe one can't reason anyone out of a position they didn't reason themselves into, but there's always pointing and laughing -------------- next part -------------- An HTML attachment was scrubbed... URL: From hochwender at centurytel.net Mon Mar 12 17:03:13 2012 From: hochwender at centurytel.net (Curt Hochwender) Date: Mon, 12 Mar 2012 17:03:13 -0700 Subject: [Kc] KC Perl mongers March meeting MOVED to 75th Street Brewery inWaldo In-Reply-To: Message-ID: I've been playing with mojolicious and dotcloud... So, I might be able to contribue as well. -----Original Message----- From: kc-bounces+hochwender=centurytel.net at pm.org [mailto:kc-bounces+hochwender=centurytel.net at pm.org]On Behalf Of Andrew Moore Sent: Monday, March 12, 2012 12:45 PM To: kc at pm.org Subject: [Kc] KC Perl mongers March meeting MOVED to 75th Street Brewery inWaldo Jonathan reminds me that tomorrow is the 2nd Tuesday in March, so it's time for the KC Perl Mongers meeting. Our regular location is closed this month, so we're meeting at 75th Street Brewery in Waldo instead. It's one block West of Wornall on 75th Street. We'll get together at the regular time: 7pm. I've been building a catalyst application on dotcloud.com this month and can chat about deploying plack applications on dotcloud. I'd also love to hear about any cheaper alternatives if anyone has experience with them. Jonathan says he has some questions about database access from a piece of code and will bring it to discuss. Please let me know if you're going to make it, and if enough folks are coming, I'll call to reserve the back room. I look forward to seeing you there! -Andy _______________________________________________ kc mailing list kc at pm.org http://mail.pm.org/mailman/listinfo/kc From amoore at mooresystems.com Wed Mar 14 06:36:19 2012 From: amoore at mooresystems.com (Andrew Moore) Date: Wed, 14 Mar 2012 08:36:19 -0500 Subject: [Kc] last night's meeting Message-ID: We had a great meeting last night at 75th Street Brewery. We chatted about tons of topics like: - Log::Log4perl - profiling and optimizing database driven applications - using DBIx::Class::Schema::Loader to investigate database schemas or bootstrap your DBIx::Class Result classes - the local employment scene - building tests with Test::More, Test::Class and friends - tons more that I've forgotten And of course we drank most of the Dry Irish Stout that they had on tap. There was pretty wide support for continuing meetings at the 75th Street Brewery, so we'll probably return there next month (Tuesday April 10). Perhaps this will let some of you folks in Missouri make it more easily. In the meantime, don't hesitate to use the mailing list or drop by #kcpm on irc.perl.org. See you in April! -Andy