Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Neha101736
#perl 5.22.1 $var="this is string scalar"; $quote=' single quote-$var'; $double="double quote-$var"; print $var; print"\n quote in quote: $quote\n"; print"\n here double: $double\n\n\n\n"; @jokers=("harry","Ron","Hermione"); @cartoons=("Roshni","Linda","Lieta"); print"\$jokers[1]=$jokers[1]\n"; print"\$cartoons[0]=$cartoons[0]\n\n\n"; %data=('hunt',200,'benji',54); print"\$data{'hunt'}=$data{'hunt'}\n\n\n"; @rhymes = (1, 2, 'Buckle','my','shoe'); @matrix3 = qw/Everything that has a beginning/; print $rhymes[2]."\n"; print $matrix3[4]."\n\n"; $var = "This is string scalar!"; $quote = 'Single quote - $var'; $double = "Double quote - $var"; print $var; print "\nThis is quote inside quotes: $quote\n"; print "\nHere we go double : $double\n\n\n\n"; @var_10=(1..10); @var_20=(10..20); @var_abc=(a..z); print"@var_10\n"; print"@var_20\n"; print"@var_abc\n\n\n"; @circus = qw/Tinker Tailor Soldier Spy/; print "1. \@circus = @circus\n"; push(@circus, "Moneypenny"); print "2. \@circus = @circus\n"; unshift(@circus, "Ilsa Faust"); print "3. \@circus = @circus\n"; pop(@circus); print "4. \@circus = @circus\n"; shift(@circus); print "5. \@circus = @circus\n"; @days = qw/Mon Tue Wed Thu Fri Sat Sun/; @weekdays = @days[3,4,5]; print "@weekdays\n"; @nums = (1..20); print "Before - @nums\n"; splice(@nums, 10, 0, 21..25); print "After - @nums\n"; $rats = "Rats live on no evil star"; $fox = "A:quick:brown:fox:jumps:over:the:lazy:dog"; @star = split(' ', $rats); @foxy = split(':', $fox); print "$star[4]\n"; print "$foxy[3]\n"; @questions = qw/Them that ask no question never told a lie/; @odds = qw/May the odds be with you/; $qstring = join(' ',@questions); $oddstring = join(',',@odds); print $qstring."\n"; print $oddstring."\n"; @sea = qw/She sells sea shells on the sea shore/; @core = (3,2,5,6,7,5,4,3,6,8,7,6); print "Before : @sea\n"; print "Before : @core\n"; @sea = sort(@sea); @core = sort(@core); print "-+-+-+-+-+-+-+-+-+-+-+\n"; print "After : @sea\n"; print "After : @core\n";
run
|
edit
|
history
|
help
0
objetos
Attractive Numbers
Aishwarya 101701
101734
Arrayop
101744
Riyali-101738
base N conversion
Supriya
Shalu Kumar