We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,313 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Can't edit code snippets anymore?

I had a need to read one of the code snippets I posted a while back (perl) and noticed the syntax highlighter has screwed up the code I posted by adding an extra backslash making the snippet no good. I thought I would just try and edit the snippet but there is no longer an edit link like there used to be. What to do?

2
Contributors
7
Replies
16 Hours
Discussion Span
6 Years Ago
Last Updated
8
Views
Question
Answered
KevinADC
Posting Shark
921 posts since Mar 2006
Reputation Points: 246
Solved Threads: 67
Skill Endorsements: 0

Due to abuse, the edit button only lasts for up to 30 minutes after you post to fix typos, etc. Please PM the code change to myself or any software dev moderator and we'll fix it for you. Or you can just post it in this thread if that's easier. However, if the highlighter screwed up the code, then it might be related to a bug, so I want to look into it ...

Dani
The Queen of DaniWeb
Administrator
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122

well it appears to add an extra \:

my $string = ' Mary had a little lamb. ';
$string =~ s/^\\s+//; #remove leading spaces
$string =~ s/\\s+$//; #remove trailing spaces
print $string;

should be (and it was)

my $string = ' Mary had a little lamb. ';
$string =~ s/^\s+//; #remove leading spaces
$string =~ s/\s+$//; #remove trailing spaces
print $string;

KevinADC
Posting Shark
921 posts since Mar 2006
Reputation Points: 246
Solved Threads: 67
Skill Endorsements: 0

seems to be OK here though:

my $string = '  Mary had a little lamb.  ';
$string =~ s/^\s+//; #remove leading spaces
$string =~ s/\s+$//; #remove trailing spaces
print $string;
KevinADC
Posting Shark
921 posts since Mar 2006
Reputation Points: 246
Solved Threads: 67
Skill Endorsements: 0

these snippets need to be edited to change all instances of double back-slashes (\\) to single back-slashes (\)

http://www.daniweb.com/code/snippet550.html
http://www.daniweb.com/code/snippet549.html
http://www.daniweb.com/code/snippet541.html

KevinADC
Posting Shark
921 posts since Mar 2006
Reputation Points: 246
Solved Threads: 67
Skill Endorsements: 0

new snippets appear to be OK, this test can be deleted:

http://www.daniweb.com/code/snippet706.html

KevinADC
Posting Shark
921 posts since Mar 2006
Reputation Points: 246
Solved Threads: 67
Skill Endorsements: 0

Fixed :) Let me know if I did it right.

Dani
The Queen of DaniWeb
Administrator
21,359 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 368
Skill Endorsements: 122
Question Answered as of 6 Years Ago by Dani

Thanks csgal, your edits are correct.

KevinADC
Posting Shark
921 posts since Mar 2006
Reputation Points: 246
Solved Threads: 67
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.7787 seconds using 2.66MB