Perl 5 (with -p, <= v5.18.2), 74 bytes
Perl 5 , 76 bytes
}{${$_=$`x/?B/?}{/?\w$/?}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?\w? is a synonym for /\w/ which gives me access to regexp matching and I have enough chars for $& (last match) and $` (text preceding last match). I need these to be able to get the O. I generate this be creating a glob reference ($_=\*G which, cast to a scalar, is something like GLOB(0x7ffb728028d0)). Once that's in $_, ?B? will match the B and $` will contain GLO, I can then match against \w$ which would store O in $& which is inserted into the strings that I'm running stringwise-AND to create the rest of the text, the body of the string is lowercased using \L.
Happy I've managed to beat SOGL , but I can't imagine it'll be that easy to golf any more bytes off if there's more competition...
Try it online! Try it online! - uses /\w/ in place of ?\w? as the version of Perl on TIO is too new.
Perl 5 , 65 bytes
This is a bit more cheaty as it relies on the filename on TIO (which is .code.tio), so I don't really think this is competing, but I was happy with the result!
}{${$_=0ドル}{?\w$?}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}
Perl 5 (with -p, <= v5.18.2), 74 bytes
${$_=$`x/B/}{/\w$/}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?\w? is a synonym for /\w/ which gives me access to regexp matching and I have enough chars for $& (last match) and $` (text preceding last match). I need these to be able to get the O. I generate this be creating a glob reference ($_=\*G which, cast to a scalar, is something like GLOB(0x7ffb728028d0)). Once that's in $_, ?B? will match the B and $` will contain GLO, I can then match against \w$ which would store O in $& which is inserted into the strings that I'm running stringwise-AND to create the rest of the text, the body of the string is lowercased using \L.
Happy I've managed to beat SOGL , but I can't imagine it'll be that easy to golf any more bytes off if there's more competition...
Try it online! - uses /\w/ in place of ?\w? as the version of Perl on TIO is too new.
Perl 5 , 76 bytes
}{${$_=$`x?B?}{?\w$?}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?\w? is a synonym for /\w/ which gives me access to regexp matching and I have enough chars for $& (last match) and $` (text preceding last match). I need these to be able to get the O. I generate this be creating a glob reference ($_=\*G which, cast to a scalar, is something like GLOB(0x7ffb728028d0)). Once that's in $_, ?B? will match the B and $` will contain GLO, I can then match against \w$ which would store O in $& which is inserted into the strings that I'm running stringwise-AND to create the rest of the text, the body of the string is lowercased using \L.
Try it online! - uses /\w/ in place of ?\w? as the version of Perl on TIO is too new.
Perl 5 , 65 bytes
This is a bit more cheaty as it relies on the filename on TIO (which is .code.tio), so I don't really think this is competing, but I was happy with the result!
}{${$_=0ドル}{?\w$?}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}
Perl 5 (with -p, <= v5.18.2), 74 bytes
${$_=$`x/B/}{/\w$/}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?\w? is a synonym for /\w/ which gives me access to regexp matching and I have enough chars for $& (last match) and $` (text preceding last match). I need these to be able to get the O. I generate this be creating a glob reference ($_=\*G which, cast to a scalar, is something like GLOB(0x7ffb728028d0)). Once that's in $_, ?B? will match the B and $` will contain GLO, I can then match against \w$ which would store O in $& which is inserted into the strings that I'm running stringwise-AND to create the rest of the text, the body of the string is lowercased using \L.
Happy I've managed to beat SOGL, but I can't imagine it'll be that easy to golf any more bytes off if there's more competition...
Try it online! - uses /\w/ in place of ?\w? as the version of Perl on TIO is too new.
Perl 5, 74 bytes
${$_=$`x/B/}{/\w$/}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?\w? is a synonym for /\w/ which gives me access to regexp matching and I have enough chars for $& (last match) and $` (text preceding last match). I need these to be able to get the O. I generate this be creating a glob reference ($_=\*G which, cast to a scalar, is something like GLOB(0x7ffb728028d0)). Once that's in $_, ?B? will match the B and $` will contain GLO, I can then match against \w$ which would store O in $& which is inserted into the strings that I'm running stringwise-AND to create the rest of the text, the body of the string is lowercased using \L.
Happy I've managed to beat SOGL, but I can't imagine it'll be that easy to golf any more bytes off if there's more competition...
Try it online! - uses /\w/ in place of ?\w? as the version of Perl on TIO is too new.
Perl 5 (with -p, <= v5.18.2), 74 bytes
${$_=$`x/B/}{/\w$/}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?\w? is a synonym for /\w/ which gives me access to regexp matching and I have enough chars for $& (last match) and $` (text preceding last match). I need these to be able to get the O. I generate this be creating a glob reference ($_=\*G which, cast to a scalar, is something like GLOB(0x7ffb728028d0)). Once that's in $_, ?B? will match the B and $` will contain GLO, I can then match against \w$ which would store O in $& which is inserted into the strings that I'm running stringwise-AND to create the rest of the text, the body of the string is lowercased using \L.
Happy I've managed to beat SOGL, but I can't imagine it'll be that easy to golf any more bytes off if there's more competition...
Try it online! - uses /\w/ in place of ?\w? as the version of Perl on TIO is too new.
Perl 5 <= 5.18.2, 8674 bytes
85 bytes code + 1 for -p.
${$_=$`x/B/}{/\w$/}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?0\w? is a synonym for /0\w/ which meansgives me access to regexp matching and I can extract the 6 fromhave enough chars for $=$& by matching against 0(last match) and using $` to access the preceding string (6text preceding last match). I've also added more of the string into the callI need these to the shell's printfbe able to makeget the match shorter as well. &Oing with. I generate this be creating a \xFFglob still yields the desired characterreference (o$_=\*G) which, but I'm sure there must be a way to get that shorter... I needcast to remove some of those slashesa scalar, it's insane!
${$_=?0?&&qq{Lg\LLL\xFF= w\xFFRLD=}&qx=\LPRINTF y}LL\\\\x$`FL\\ _\\\\x$`FRLDA=}=$_=$=
Try it online! (Note: the version of Perl is too new on TIO, so the call to something like GLOB(0x7ffb728028d0) ). Once that's in ?0?$_ has been replaced with, /0/?B?.)
Perl 5 , 92 bytes
91 bytes code + 1 for -p.
This will probably only work on *nix machines and also relies onmatch the details in this meta post for empty input (which TIO doesn't support, so a newline is provided -B and never used).
${$_=qq{Lg\LLL$*= w$*RLD=}&qq=y}\LLL$*L _$*RLDA=}=${$*=`\LPRINTF \\\\X$_`}=$A{y?0?F?}=$_=$=
###Explanation
The basis for this script is utilising the &$` operator on strings, I was able to get Hell0, W0rld! just using :
$_=qq{Lg\LLL0= w0RLD=}&qq=y}\LLL0L _0RLDA=
# qq{} is a a synonym for ""
# \L converts the remainder of the string to lowercase
# I found these chars lazily by brute forcing all combinations and grepping for the desired char
Getting thewill contain oGLO was a little more tricky however. Fortunately, the hex char code forI can then match against o\w$ iswhich would store 6FO andin $=$& which is preinserted into the strings that I'm running stringwise-initialisedAND to 60create the rest of the text, knowing this meant I could utilise the body of the string is lowercased using y{}{}\L operator.
Happy I've managed to changebeat 0SOGL , but I can't imagine it'll be that easy to F with some trickery:golf any more bytes off if there's more competition...
$_=$=; # $_ is now 60 both valid variable names!
y?0?F?; # y (alias for tr///, you can use any delimiter) works on $_ by default, $_ is now 6F
$*=`\LPRINTF \\\\X$_`; # $* is now o
# I used $* instead of $A or something so I don't need to do ${A} when it's followed by another letter, a warning is displayed in the console, but these are ignored by default.
Chaining this all up withoutTry it online! - uses ;/\w/ orin place of ,?\w? was a little tricky as well, but I was able to chain assign to variables and hashes in the reverse order of how I needed things to happen, which gives the desired result.
This was a lotversion of fun and I've been tinkeringPerl on and off for about a dayTIO is too new. Great idea for a challenge!
Perl 5 <= 5.18.2, 86 bytes
85 bytes code + 1 for -p.
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?0? is a synonym for /0/ which means I can extract the 6 from $= by matching against 0 and using $` to access the preceding string (6). I've also added more of the string into the call to the shell's printf to make the match shorter as well. &ing with \xFF still yields the desired character (o), but I'm sure there must be a way to get that shorter... I need to remove some of those slashes, it's insane!
${$_=?0?&&qq{Lg\LLL\xFF= w\xFFRLD=}&qx=\LPRINTF y}LL\\\\x$`FL\\ _\\\\x$`FRLDA=}=$_=$=
Try it online! (Note: the version of Perl is too new on TIO, so the call to ?0? has been replaced with /0/.)
Perl 5 , 92 bytes
91 bytes code + 1 for -p.
This will probably only work on *nix machines and also relies on the details in this meta post for empty input (which TIO doesn't support, so a newline is provided - and never used).
${$_=qq{Lg\LLL$*= w$*RLD=}&qq=y}\LLL$*L _$*RLDA=}=${$*=`\LPRINTF \\\\X$_`}=$A{y?0?F?}=$_=$=
###Explanation
The basis for this script is utilising the & operator on strings, I was able to get Hell0, W0rld! just using :
$_=qq{Lg\LLL0= w0RLD=}&qq=y}\LLL0L _0RLDA=
# qq{} is a a synonym for ""
# \L converts the remainder of the string to lowercase
# I found these chars lazily by brute forcing all combinations and grepping for the desired char
Getting the o was a little more tricky however. Fortunately, the hex char code for o is 6F and $= is pre-initialised to 60, knowing this meant I could utilise the y{}{} operator to change 0 to F with some trickery:
$_=$=; # $_ is now 60 both valid variable names!
y?0?F?; # y (alias for tr///, you can use any delimiter) works on $_ by default, $_ is now 6F
$*=`\LPRINTF \\\\X$_`; # $* is now o
# I used $* instead of $A or something so I don't need to do ${A} when it's followed by another letter, a warning is displayed in the console, but these are ignored by default.
Chaining this all up without ; or , was a little tricky as well, but I was able to chain assign to variables and hashes in the reverse order of how I needed things to happen, which gives the desired result.
This was a lot of fun and I've been tinkering on and off for about a day. Great idea for a challenge!
Perl 5, 74 bytes
${$_=$`x/B/}{/\w$/}{$_=qq{Lg\LLL$&= w$&RLD=}&qq=y}\LLL$&L _$&RLDA=}=$_=\*G
This uses a feature that has been deprecated, but works locally in my terminal (which is version 5.18.2 as noted). In older versions of Perl ?\w? is a synonym for /\w/ which gives me access to regexp matching and I have enough chars for $& (last match) and $` (text preceding last match). I need these to be able to get the O. I generate this be creating a glob reference ($_=\*G which, cast to a scalar, is something like GLOB(0x7ffb728028d0) ). Once that's in $_, ?B? will match the B and $` will contain GLO, I can then match against \w$ which would store O in $& which is inserted into the strings that I'm running stringwise-AND to create the rest of the text, the body of the string is lowercased using \L.
Happy I've managed to beat SOGL , but I can't imagine it'll be that easy to golf any more bytes off if there's more competition...
Try it online! - uses /\w/ in place of ?\w? as the version of Perl on TIO is too new.