Welcome to the E-Blah Community!
We would like to welcome you to our community and invite you to register an account or login.
Being a registered member is important, as it gives you several advantages over the normal Guest status. After registering you will be able to download files and images, post messages, and access member-only portions of the forum - just to name a few. Registration is quick and simple, and only takes about a minute of your time.

E-Blah Community    General Discussion    Chit - Chat  ›  QUICK! Need help! PERL programmers!
Users Browsing Forum
No Members and 1 Guests

QUICK! Need help! PERL programmers!  This thread currently has 1,145 views. Print
2 Pages « 1 2 Recommend Thread
Justin
January 27, 2007, 9:31pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,075
Gender: Male
Posts Per Day: 6.52
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 27 minutes
Location: Tallassee, AL
Age: 22
I wouldn't delete the array variables like that ...


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV

Logged Offline
Site Site Private Message Private message Reply: 15 - 21
tylermenezes
January 27, 2007, 9:35pm Report to Moderator Report to Moderator

Anybody here speak Python? HHHSSSSSSSSSSSSSS!
Posts: 201
Gender: Male
Posts Per Day: 0.21
Reputation: 90.48%
Reputation Score: +19 / -2
Time Online: 1 days 5 hours 56 minutes
Location: Redmond, Washington
Age: 16
It works though. The only relievent part is:

Code
chomp @memberdb;
foreach $arraystring (@memberdb) {	
($username,$quarter,$dateisued,$lunch) = split(/\|/,$arraystring);
push(@usernames, $username);
push(@quarters, $quarter);
push(@dateissueds, $dateisued);
push(@lunches, $lunch);
}
$count = 0;
foreach $user (@usernames) {
	if($user eq $td){
	delete @usernames[$count];
	delete @quarters[$count];
	delete @dateissueds[$count];
	delete @lunches[$count];	
	$count--;
	}
$count++;
}


And all I need help on is "if($user eq $td){". I don't really care about speed, I just need to know why this deletes both "John Smith" and "Jane Smith" and "John Doe". Could you help me, or suggest a better way of going about this? This is the last feature to fall into place, and then I can release it.


Logged Offline
Site Site Private Message Private message Reply: 16 - 21
Justin
January 27, 2007, 11:35pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,075
Gender: Male
Posts Per Day: 6.52
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 27 minutes
Location: Tallassee, AL
Age: 22
I don't really see what you're doing.

Code
open(SOMEFILE,"file.txt");
foreach $arraystring (@memberdb) {	
	($username,$quarter,$dateisued,$lunch) = split(/\|/,$arraystring);
	if($username eq 'someuser') { next; }
	push(@usernames, $username);
	push(@quarters, $quarter);
	push(@dateissueds, $dateisued);
	push(@lunches, $lunch);
	print SOMEFILE "$username|$quarter|$dateisued|$lunch\n";
}
close(SOMEFILE);


It's not near as hard as your delete thing is making it ...


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV

Logged Offline
Site Site Private Message Private message Reply: 17 - 21
tylermenezes
January 27, 2007, 11:39pm Report to Moderator Report to Moderator

Anybody here speak Python? HHHSSSSSSSSSSSSSS!
Posts: 201
Gender: Male
Posts Per Day: 0.21
Reputation: 90.48%
Reputation Score: +19 / -2
Time Online: 1 days 5 hours 56 minutes
Location: Redmond, Washington
Age: 16
How do I do it then? I need to: delete a line belonging to a member I know: The username

Remember, this is stored in a file in the format mentioned previously.


Logged Offline
Site Site Private Message Private message Reply: 18 - 21
Justin
January 27, 2007, 11:45pm Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,075
Gender: Male
Posts Per Day: 6.52
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 27 minutes
Location: Tallassee, AL
Age: 22
I just showed you how.  Make sure you do > before the filename, though.  You want to rewrite the file, not read it.


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  |  MinistryTalk.com  |  Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV

Logged Offline
Site Site Private Message Private message Reply: 19 - 21
tylermenezes
January 27, 2007, 11:48pm Report to Moderator Report to Moderator

Anybody here speak Python? HHHSSSSSSSSSSSSSS!
Posts: 201
Gender: Male
Posts Per Day: 0.21
Reputation: 90.48%
Reputation Score: +19 / -2
Time Online: 1 days 5 hours 56 minutes
Location: Redmond, Washington
Age: 16
oh, sorry. thouht you were quoting my code  


Logged Offline
Site Site Private Message Private message Reply: 20 - 21
tylermenezes
January 27, 2007, 11:59pm Report to Moderator Report to Moderator

Anybody here speak Python? HHHSSSSSSSSSSSSSS!
Posts: 201
Gender: Male
Posts Per Day: 0.21
Reputation: 90.48%
Reputation Score: +19 / -2
Time Online: 1 days 5 hours 56 minutes
Location: Redmond, Washington
Age: 16
Thanks for all the help here. In the unlikly () event I could help you in any way, just let me know.

It works, fully!



Revision History (3 edits)
tylermenezes  -  January 28, 2007, 12:19am
tylermenezes  -  January 28, 2007, 12:14am
tylermenezes  -  January 28, 2007, 12:11am
Logged Offline
Site Site Private Message Private message Reply: 21 - 21
2 Pages « 1 2 Recommend Thread
Print

E-Blah Community    General Discussion    Chit - Chat  ›  QUICK! Need help! PERL programmers!