Skip Menu |
Update: The bug tracker service is no longer shutting down.

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

Report information
The Basics
Id: 14852
Status: open
Priority: 0/
Queue: IO-Prompt

Owner: Nobody in particular
Requestors: ghenry [...]

Bug Information
Severity: Unimportant
Broken in: 0.99.2
Fixed in: (no value)

Subject: Bypassing the menu option via $ARGV[0]?
Download (untitled) / with headers
text/plain 384b
This is also relating to 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.
Date: Sat, 01 Oct 2005 11:35:42 +1000
From: Damian Conway <damian [...]>
To: bug-IO-Prompt [...]
Subject: Re: [cpan #14852] Bypassing the menu option via $ARGV[0]?
Download (untitled) / with headers
text/plain 179b
Show quoted text
> This is also relating to
Thanks for drawing it to my attention, Gavin. See my reply at: Damian
From: jaybuffington [...]
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:~$ ./ 4141849643 Can't open 4141849643: No such file or directory at ./ 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.
From: jaybuffington [...]
Download (untitled) / with headers
text/plain 124b
Sorry, I pasted the corrected version of the script. The incorrect version doesn't have the -t in the prompt() options. :)

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to