3,739
Loading...
Uploader Comments (blackturtleshow)
Video Responses
This video is a response to Cmd tricks that will blow your mind
see all
All Comments (20)
-
Now I can hide dirty pictures from anyone on plain sight =)
-
@wowonice1 Actually the demo program is really short, so here's the whole thing:
#!/usr/bin/perl
$str = "TTAAGGCCATGCGGATACACGATGAC";
print "ORIGINAL: $str\n";
$str =~ s/T/U/g;
print "AFTER SUBSTITUTION: $str\n";
FROM:
blackturtle.us/BIOINFO/BIOPERL
2/bp2_02.html -
$str =~ s/T/U/g;
This line substitutes a U for all instances of T in the string $str (in this case a nucleotide sequence).
-
If i'm using windows 7 and I wanted to execute this out of a command prompt directly from a .pl file, i assume this would not be the correct syntax. could you respond back what would be?
Loading...
Can't you just use perl -pie? Easier to remember and mmm... perl pie. Also, that's only reversible if the word starts with the letter being replaced. If you were to do /d/california/, then any original instances of california in the file (not likely in a JPEG) will be mangled when you do /california/d/.
uzimonkey 1 month ago
@uzimonkey Thanks for watching! Using -pie won't work. (I double-checked just now.) Secondly, it doesn't matter what the word STARTS with. All that matters is that the new pattern that is created doesn't already exist in the target file. That's what I mean by one-to-one and many-to-one pattern substitutions. I didn't explain this fully or give examples since I wanted to keep the video short. Also I figured people who are interested would experiment around and figure it out that way.
blackturtleshow 1 month ago
@blackturtleshow Actually, it will work if california already exists in the file and you use c. If you do /c/california/ it would end up as califroniaalifornia, which will go back to california when you do /california/c/.
uzimonkey 1 month ago
@uzimonkey True, but in that case you're modifying an existing pattern as opposed to replicating an existing pattern.
blackturtleshow 1 month ago
machontosh huh, im a loyal windows user but mac is pretty popular these days
PIKAMONjake 6 months ago
@PIKAMONjake Actually, I have a Windows computer, as well as two Macs and two Linux boxes. It might be some kind of addiction! ;)
blackturtleshow 6 months ago