Previous Thread
Next Thread
Print Thread
Rate Thread
#102179 02/09/2001 12:20 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
for some reason that i cant figure out chomp isnt working for me any ideas?
Code
code:
It dosent get rid of the n at the end of it so it trys to open it like
a
/a
.txt
how can i get it to work?

actually i just tried some other ways like chop and search&reaplce and none of them are doing anything.

[ February 09, 2001: Message edited by: Wartortle ]


Wartortle

I'm supposed to put somthin here? wink
Sponsored Links
#102180 02/09/2001 1:44 PM
Joined: Feb 2001
Posts: 30
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 30
Maybe you should get it in a scalarvariable:
like:

Code
code:

You get all the variables in @a in the scalar $b, and chomp it...
Then split at the , and your done

Hope this works..

Well I'm kinda newbie in Perl, so tell me if I'm wrong!
Please! smile


COGITO ERGO SUM
#102181 02/09/2001 11:23 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
you cant chomp arrays, if you want to get rid of the carriage return on each line:

foreach (@a) {
chomp $_;

open(B,"$_.txt") or die $!;
@b = ;
close B;
}

#102182 02/09/2001 11:33 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Code
quote:</font><HR>you cant chomp arrays<HR></BLOCKQUOTE>

Might wanna try that to verify before stating ya can't ;)

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, Arial">code:

output:

this
is
stuff
in
the
array

thisisstuffinthearray

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#102183 02/10/2001 11:23 AM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
ok i figured out why its not working.. acutally chomp is working.. for some reason the files its reading that i made it says that each newline i made with my Enter key is unidentified.. i just tried making the files through the program with n and it works fine.. anyone know why it dosent count my Enter key a n? it used to.

[ February 10, 2001: Message edited by: Wartortle ]


Wartortle

I'm supposed to put somthin here? wink
Sponsored Links
#102184 02/10/2001 12:19 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
That's strange. Are you on a regular windows machine?


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#102185 02/12/2001 5:54 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
yeah im on regular windows.. i recently installed pws (personal web server) and rpgmaker2000
you think one of those could have caused it?


Wartortle

I'm supposed to put somthin here? wink

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)