This queue is for tickets about the IO-Prompt CPAN distribution.

Report information
The Basics
Id:
14852
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
ghenry [...] perl.me.uk
Cc:
AdminCc:

BugTracker
Severity:
Unimportant
Broken in:
0.99.2
Fixed in:
(no value)



Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.417 (Entity 5.417)
Subject: Bypassing the menu option via $ARGV[0]?
X-RT-Original-Encoding: iso-8859-1
Content-Length: 384
This is also relating to http://perlmonks.org/?node_id=496268 Tanktalus and myself are discussing what happened to the menu I generated, i.e. it being bypassed by a commandline option: my $avi = $ARGV[0]; but changing that to: my $avi = shift; and it's fine. Do you think it's worth mentioning this in the docs, or is this something to do with my coding skills? Thanks, Gavin.
Return-Path: <damian@conway.org>
X-Original-To: bug-IO-Prompt@rt.cpan.org
Delivered-To: cpan-bug+io-prompt@diesel.bestpractical.com
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 0E72D4D8285 for <bug-IO-Prompt@rt.cpan.org>; Fri, 30 Sep 2005 21:36:05 -0400 (EDT)
Received: (qmail 19361 invoked by alias); 1 Oct 2005 01:35:53 -0000
X-Spam-Check-BY: la.mx.develooper.com
Received-SPF: pass (x1.develooper.com: domain of damian@conway.org designates 205.158.62.196 as permitted sender)
Received: from ws6-1.us4.outblaze.com (HELO ws6-1.us4.outblaze.com) (205.158.62.196) by la.mx.develooper.com (qpsmtpd/0.28) with SMTP; Fri, 30 Sep 2005 18:35:51 -0700
Received: (qmail 21315 invoked from network); 1 Oct 2005 01:35:47 -0000
Received: from unknown (HELO ?10.0.1.5?) (damian@conway.org@203.129.144.179) by ws6-1.us4.outblaze.com with SMTP; 1 Oct 2005 01:35:47 -0000
Message-ID: <433DE7EE.9080206@conway.org>
Date: Sat, 01 Oct 2005 11:35:42 +1000
From: Damian Conway <damian@conway.org>
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8) Gecko/20050511
X-Accept-Language: en, en-us
MIME-Version: 1.0
To: bug-IO-Prompt@rt.cpan.org
Subject: Re: [cpan #14852] Bypassing the menu option via $ARGV[0]?
References: <rt-14852-44482.5.78665859762218@cpan.org>
In-Reply-To: <rt-14852-44482.5.78665859762218@cpan.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
RT-Send-Cc:
X-RT-Original-Encoding: us-ascii
Content-Length: 179
Show quoted text
> This is also relating to http://perlmonks.org/?node_id=496268
Thanks for drawing it to my attention, Gavin. See my reply at: http://www.perlmonks.org/?node_id=496579 Damian
MIME-Version: 1.0
In-Reply-To: <433DE7EE.9080206@conway.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-14852-44482.5.78665859762218@cpan.org> <433DE7EE.9080206@conway.org>
Message-Id: <rt-3.6.HEAD-18680-1160081126-95.14852-0-0@rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: jaybuffington@gmail.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1076
This just bit me. Ouch! My script looks something like this: #!/usr/bin/perl use strict; use warnings; use IS::Creative; use IO::Prompt; foreach my $creative_id (@ARGV) { my $creative = IS::Creative->new( $creative_id ); if ( !$creative->exists() ) { warn "Creative #$creative_id doesn't exist, skipping"; } if ( prompt("Are you sure you want to delete creative #$creative_id? ", '-yt') ) { $creative->delete(); print "Creative $creative_id deleted!\n"; } } Example run: jay@webdev:~$ ./delete_creatives.pl 4141849643 Can't open 4141849643: No such file or directory at ./delete_creatives.pl line 16 jay@webdev:~$ After reading this discussion I added -t to the prompt() options, and things started working like I expected. I probably would have solved this problem this much faster (boy was I confused!) if the "Can't open %s: %s" part of the DIAGNOSTICS section added a line like this: If @ARGV contains something other than a file when prompt() is called, either use the -tty option or remove those values from @ARGV.
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-18680-1160081126-95.14852-0-0@rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-14852-44482.5.78665859762218@cpan.org> <433DE7EE.9080206@conway.org> <rt-3.6.HEAD-18680-1160081126-95.14852-0-0@rt.cpan.org>
Message-Id: <rt-3.6.HEAD-18657-1160081210-669.14852-0-0@rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: jaybuffington@gmail.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 124
Sorry, I pasted the corrected version of the script. The incorrect version doesn't have the -t in the prompt() options. :)


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.