Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
*note the spaces in front of the string I want to print it out as:"HP LaserJet IIISi" {set model "net_ljx000"} "HP PaintJet XL300" {set model "net_dsnj"} "HP LaserJet 4 Plus / 4M Plus" {set model "net_lj4x"} "HP LaserJet 5L" {set model "net_lj4x"} "HP LaserJet 5MP" {set model "net_lj4x"} "HP LaserJet 5P" {set model "net_lj4x"}
I tried with the following:modelCombo.addItem("HP LaserJet IIISi"); modelCombo.addItem("HP PaintJet XL300"); modelCombo.addItem("HP LaserJet 4 Plus / 4M Plus"); modelCombo.addItem("HP LaserJet 5L"); modelCombo.addItem("HP LaserJet 5MP"); modelCombo.addItem("HP LaserJet 5P");
What I got was:open( IN, "print_tools.txt" )or die("Cannot open print_tools.txt for r +eading: $!" ); while(<IN>) { print "modelCombo.addItem($_)\n" if s/{\w+\W+\w+\W+\w+\W?}//g; + }
Any suggestions on how I could fix my code.modelLabel.addItem( "HP LaserJet IIISi" )modelLabel.addItem( "HP PaintJet XL300" )modelLabel.addItem( "HP LaserJet 4 Plus / 4M Plus" )modelLabel.addItem( "HP LaserJet 5L" )modelLabel.addItem( "HP LaserJet 5MP" )modelLabel.addItem( "HP LaserJet 5P" )
Edit: Added <code> tags. larsen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with string manipulation
by tachyon (Chancellor) on Jan 03, 2003 at 22:45 UTC | |
|
Re: Problem with string manipulation
by gjb (Vicar) on Jan 03, 2003 at 22:50 UTC | |
|
Re: Problem with string manipulation
by fruiture (Curate) on Jan 03, 2003 at 22:43 UTC | |
|
Re: Problem with string manipulation
by Mr. Muskrat (Canon) on Jan 03, 2003 at 22:25 UTC | |
by webengr (Pilgrim) on Jan 03, 2003 at 23:18 UTC | |
by Anonymous Monk on Jan 03, 2003 at 22:45 UTC |